Javascript 解析URL并在纯文本上创建链接

Javascript 解析URL并在纯文本上创建链接,javascript,node.js,pug,template-engine,Javascript,Node.js,Pug,Template Engine,我得到的纯文本中可能有一个网址 例如 当前位置一天学习abc www.englishspeaking.com 这里我有一个网址。我想转换它有一个链接。我使用的是Jade模板引擎。在Jade模板引擎中是否有这样做的方法。使用标记这样的过滤器 :markdown this is the start of the para. [a link](http://example.com) and this is the rest of the paragraph. 像这样使用markdown过

我得到的纯文本中可能有一个网址

例如 当前位置一天学习abc www.englishspeaking.com


这里我有一个网址。我想转换它有一个链接。我使用的是Jade模板引擎。在Jade模板引擎中是否有这样做的方法。

使用
标记
这样的过滤器

:markdown
  this is the start of the para.
  [a link](http://example.com)
  and this is the rest of the paragraph.

像这样使用
markdown
过滤器

:markdown
  this is the start of the para.
  [a link](http://example.com)
  and this is the rest of the paragraph.

您可以为此使用已构建的npm。像这样,我发现它也对我有用

你可以用它来构建npm。像这样,我发现它也对我有用

谢谢你的回复。用我的例子,我可以这样做:markdown[a link](一天内学会abc www.englishspeaking.com)?@MAS1112试着这样做:一天内学会abc a(href='www.englishspeaking.com'),这样就行了。我必须首先从文本解析url。好的,我明白了:)。。让我也等待其他人的贡献。谢谢你的回复。用我的例子,我可以这样做:markdown[a link](一天内学会abc www.englishspeaking.com)?@MAS1112试着这样做:一天内学会abc a(href='www.englishspeaking.com'),这样就行了。我必须首先从文本解析url。好的,我明白了:)。。让我也等待其他人,做出贡献。