0
如何用小鬍子創建主動可點擊的鏈接? 我寧願爲此使用javascript版本的鬍子。如何使用小鬍子創建活動鏈接?
換句話說:
我想自動鏈接用戶生成的文本內容與JavaScript /小鬍子(= linkify)。
模板
{{#.}}
<div>{{.}}</div>
{{/.}}
數據
[
'User content, like regular text.',
'User content with text and links http://www.google.com or secure https://www.google.com'
]
輸出我在尋找
<div>User content, like regular text.</div>
<div>User content with text and links <a href="http://www.google.com">http://www.google.com</a> or secure <a href="https://www.google.com">https://www.google.com</a></div>
謝謝,救了我的一天! :) – kaulusp
歡迎:)但如果內容是由用戶生成的,小心不要渲染一些不需要的js腳本,它可以做壞事。 – lavrik