摘要:
handlebars.js 用 替换掉 内容的换行符JS:Handlebars.registerHelper('breaklines', function(text) { text = Handlebars.Utils.escapeExpression(text); text = text.toString(); text = text.replace(/(\r\n|\n|\r)/gm, ''); return new Handlebars.SafeString(text);}); HTML template: {{breaklines description} 阅读全文