javascript - Convert some fixed format documents into format documents with a tag
怪我咯
怪我咯 2017-05-18 10:46:16
0
1
510

Those who report problems, please simply take a look at the problem carefully and see if you can solve it before reporting it. This is not about converting txt to html. Reporting the problem without reading it is really high quality!

The document format is as follows:
https://www.baidu.com
You will know it by Baidu

https://www.zhihu.com
Zhihu

https://www.github.com
Github

http://m.sina.com/beta
Sina Weibo

…………

I want to convert this format into link text wrapped in html a tags, for example:
You will know it in Baidu
Zhihu
Gihub
Sina Weibo
How to achieve it ?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all (1)
我想大声告诉你

An idea, not verified yet

Regular matching newline, $1 is the link, $2 is the text. Then replace it with regular expression to generate the link text you want

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!