replacing unlinked locations with links

View: New views
1 Messages — Rating Filter:   Alert me  

replacing unlinked locations with links

by king vash :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I view a forum were links are not allowed so everyone posts the text of the link (ex http://google.com)   instead of google so I attempted to fix it.

However my script ends up with "%gt" (the great than symbol) instead of "<" what should I do?

alert('Works at the top');

textnodes = document.evaluate(
    "//text()",
    document,
    null,
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
    null);

for (var i = 0; i < textnodes.snapshotLength; i++) {
    node = textnodes.snapshotItem(i);
   if ( node.data.indexOf('imageshack.us') > 0 ) {
      s = node.data;
      s = s.link(s);
//      alert(s);
      node.data = s;
    }
}