我有一个MVC3应用程序,它有一个详细信息页面.作为其中的一部分,我有一个描述(从数据库中检索)有空格和新行.渲染时,html会忽略新的行和空格.我想编码那些空格和新行,以便它们不被忽略.
你是怎样做的?
我尝试了HTML.Encode,但它最终显示了编码(甚至没有在空格和新行上,而是在其他一些特殊字符上)
ESLint:403行超过最大行长120(max-len)
我有一个很长的字符串,我使用 ES6 模板字符串构建,但我希望它没有换行符:
var string = `Let me be the 'throws Exception’ to your 'public static void
main (String[] args)’. I will accept whatever you give me my ${love}.`
console.log(string);
Run Code Online (Sandbox Code Playgroud)
结果:
Let me be the 'throws Exception’ to your 'public static void
main (String[] args)’. I will accept whatever you give me xxx.
Run Code Online (Sandbox Code Playgroud)
我的期望:
Let me be the 'throws Exception’ to your 'public static void main (String[] args)’. I will accept whatever you give me xxx.
Run Code Online (Sandbox Code Playgroud)
要求:
我不能禁用 …