![](/img/trans.png)
[英]How can I add line break to html text without using any html tag
[英]how can I use line break without any tag in html?
我想使用ajax在我的react代码中返回一些结果,现在我应该在第二页中使用换行符并返回结果,但是我不能使用<br/>
因为我的结果显示了如下标记: hi br/ hi
。 如何在没有任何html标记的情况下插入换行符? 我的ajax代码:
$.ajax({
'async': false,
'type': "POST",
'global': false,
'dataType': 'html',
'url': "barRules.bc",
'data': { 'id': JSON.stringify(id) },
'success':(response)=>{
tmp = response;
}
});
我的第二页:“ @Field:br / @value /”
使用white-space
css属性并将其设置为pre-line
以便在html中保留新行。
.keep-new-line{
white-space: pre-line;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.