丝袜av在线观看|日本美女三级片在线播放|性欧美一区二区三区|小骚热免费国产视频|黑人va在线观看|女同国产91视频|五月丁香色播Av|国产凸凹视频一区二区|伊人电影久久99|国产成人无码一区二区观看

將多行文本按換行符轉(zhuǎn)換成html標(biāo)簽

安企CMS模板中怎么將多行文本按換行符轉(zhuǎn)換成html標(biāo)簽?

linebreaks 過(guò)濾器可以將多行文本按換行符轉(zhuǎn)換成html標(biāo)簽。每行開頭和結(jié)尾采用<p></p>包裹,中間有空行則采用 <br/>

還可以使用 linebreaksbr 來(lái)進(jìn)行處理。與 linebreaks不同的地方是,linebreaksbr只是直接將換行符替換成 <br/>,并且不在開頭和結(jié)尾添加p標(biāo)簽。

還可以使用 linenumbers 來(lái)給多行文本的每一行進(jìn)行標(biāo)號(hào),符號(hào)從1開始。如 1.。

使用方法

linebreaks 過(guò)濾器的使用方法:

}

linebreaksbr 過(guò)濾器的使用方法:

}

linenumbers 過(guò)濾器的使用方法:

}

比如處理字符串 this is a text\nwith a new line in it,則可以這么寫:

}

顯示結(jié)果

<p>this is a text<br />with a new line in it</p>

示例演示

linebreaks 過(guò)濾器

}
}
}
}

顯示結(jié)果

<p>this is a text<br />with a new line in it</p> <p>This is a simple text.</p><p>This too, as a paragraph.<br />Right?</p><p>Yep!</p> <p>john doe</p>

linebreaksbr 過(guò)濾器

}
}
}
}

顯示結(jié)果

this is a text<br />with a new line in it This is a simple text.</p><p>This too, as a paragraph.<br />Right?</p><p>Yep! john doe

linenumbers 過(guò)濾器

}

顯示結(jié)果

  1. This is a simple text.
  2. This too, as a paragraph.
  3. Right?
  4. Yep!
問(wèn)題反饋可加技術(shù)微信:tsrz001
目錄