相关疑难解决方法(0)

jquery删除新行,然后用block元素包装textnodes

我有一些像这样的段落:

"这是第一段.r\r \n \n这是第二个在\n \n \n \n \n \n之后有很多新行的那个和最后一段.\n\r \n"

我想删除新行并用<p>标记包装每个段落.我期待输出如下:

<p>This is the first para.</p>
<p>This is the second one with lot of new line after</p>
<p>And the last para.</p>
Run Code Online (Sandbox Code Playgroud)

javascript regex jquery

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

javascript ×1

jquery ×1

regex ×1