Вариант на основе решения
Gvozd ...
<!DOCTYPE >
<html>
<head>
<title></title>
<script type="text/javascript">
var dom_replace_links = function (c) {
(function (c) {
for (var d = /(https?:\/\/\S*)|(www\.\S*)|(\S+\.(ru|net|com|kr|jp)\S*)/mig,
g = function (a) {
var b = a;
/https?:\/\//.test(a) || (a = "http://" + a);
return '<a href="' + a + '" target="_blank">' + b + "</a>"
}, b = c.childNodes, a = b.length - 1; a >= 0; a--)
if (!/^a|script|style$/i.test(b[a].tagName))
if (d.lastIndex = 0, b[a].hasChildNodes()) arguments.callee(b[a]);
else if (b[a].nodeType == 3 && d.test(b[a].nodeValue)) {
var e = document.createElement("div");
e.innerHTML = b[a].nodeValue.replace(d, g);
for (var f = document.createDocumentFragment(); e.firstChild;) f.appendChild(e.firstChild);
b[a].parentNode.replaceChild(f, b[a])
}
})(c)
};
window.onload=function(){dom_replace_links(document.body)};
</script>
</head>
<body>
<a href="http://javascript.ru/" target="_blank">http://javascript.ru/</a> <br /> тест http://javascript.ru/
<p style=" background-color: #FFFF00">javascript.ru http://javascript.ru/forum/images/ca_serenity/misc/logo.gif </p>
<img src="http://javascript.ru/forum/images/ca_serenity/misc/logo.gif" border="0" alt="" />
</body>
</html>