Global.helma.Html.prototype.activateUrls (str)
function parses a string and converts any found URL into a HTML link tag

  • Returns
    String resulting string with activated URLs
Sourcecode in /home/hannes/helma/modules/helma/Html.js:
815:   helma.Html.prototype.activateUrls = function(str) {
816:       var re = /(^|\/>|\s+)([fhtpsr]+:\/\/[^\s]+?)([\.,;:\)\]\"]?)(?=[\s<]|$)/gim;
817:       var func = function(str, p1, p2, p3) {
818:           res.push();
819:           res.write(p1);
820:           res.write('<a href="');
821:           res.write(p2);
822:           res.write('">');
823:           res.write(p2.clip(50, "...", true));
824:          res.write('</a>');
825:          res.write(p3);
826:          return res.pop();
827:      };
828:      return str.replace(re, func);
829:  }