From e60ecfce9bca136a04fa07c5fb26416750bdcbd6 Mon Sep 17 00:00:00 2001 From: "samuel%sieb.net" Date: Mon, 18 Feb 2002 22:50:59 +0000 Subject: [PATCH] Bug 122347 - fix non-http links r=rginda chatzilla only git-svn-id: svn://10.0.0.236/trunk@114816 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/extensions/irc/xul/content/static.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mozilla/extensions/irc/xul/content/static.js b/mozilla/extensions/irc/xul/content/static.js index 0fce1ee3a5b..d4c7c79ab13 100644 --- a/mozilla/extensions/irc/xul/content/static.js +++ b/mozilla/extensions/irc/xul/content/static.js @@ -410,10 +410,10 @@ function initHost(obj) obj.munger = new CMunger(); obj.munger.enabled = true; + obj.munger.addRule ("link", obj.linkRE, insertLink); obj.munger.addRule ("mailto", /(?:\s|\W|^)((mailto:)?[^<>\[\]()\'\"\s]+@[^.<>\[\]()\'\"\s]+\.[^<>\[\]()\'\"\s]+)/i, insertMailToLink); - obj.munger.addRule ("link", obj.linkRE, insertLink); obj.munger.addRule ("bugzilla-link", /(?:\s|\W|^)(bug\s+#?\d{3,6})/i, insertBugzillaLink); obj.munger.addRule ("channel-link", @@ -458,10 +458,10 @@ function insertLink (matchText, containerTag) var href; - if (matchText.indexOf ("://") == -1) - href = "http://" + matchText; - else + if (matchText.match (/^[a-zA-Z-]+:/)) href = matchText; + else + href = "http://" + matchText; var anchor = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:a");