码迷,mamicode.com
首页 > Web开发 > 详细

js操作文章、字符串换行

时间:2019-04-24 19:18:19      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:第一步   https   ima   生效   color   技术   space   detail   文章   

操作前:

技术图片

 

操作后:

 技术图片

 

第一步:

把中英文的逗号和顿号置换为 ‘\n’

support_unit = support_unit.replace(/,|,|、/g, ‘\n‘)
 
第二步:
 //为了使\n生效
    white-space: pre;

 

参考:https://blog.csdn.net/ccmedu/article/details/82021065

js操作文章、字符串换行

标签:第一步   https   ima   生效   color   技术   space   detail   文章   

原文地址:https://www.cnblogs.com/ww01/p/10764081.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!