当服务端 Freemarker 输出的值是包含换行符的字符串, 并且输出到前端需要作为 javascript 变量或常量的值, 需要使用 js_string 进行转换, 否则换行符可能会导致 javascript 语法异常, 正确示例:
{selfIntroduction: '${userInfo.selfIntroduction?js_string}'}
来源: http://www.bubuko.com/infodetail-2725907.html