2
我有幾個字符串中有鏈接。例如:提取並添加鏈接到字符串中的URL
var str = "I really love this site: http://www.stackoverflow.com"
,我需要一個鏈接標籤添加到這樣STR將是:
I really love this site: <a href="http://www.stackoverflow.com">http://www.stackoverflow.com</a>
您可以使用如下所述的actionpack:http://stackoverflow.com/questions/1442143/ruby-linkify-for-urls-in-strings/1442382#1442382 – Mischa 2011-05-13 14:34:26
[將URL和@ *轉換爲鏈接](http://stackoverflow.com/questions/4571229/turn-urls-and-into-links) – Phrogz 2011-05-13 15:24:35