我想将以下文本解析为带有锚标记的格式化 URL:
something is wrong with http://www.gbin1.com/index.html, but cannot find the reason in http://www.google.com
如何<a href="url">url</a>
使用 JavaScript 替换上面的文本 URL 并缩短它,如下所示:
something is wrong with <a href="http://www.gbin1.com/index.html">gbin1.com</a>, but cannot find the reason in <a href="http://www.gbin1.com">google.com</a>