X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2Fformateur.js;h=1cc88c26a541be048b101d5e3b1c6f2a6860f1b3;hp=b7ec0eb89d7a2b1c6608c8ca53c027a6679edc75;hb=76bcba66b341128f518ed77a40f640048cd006fd;hpb=eb8708a7450d6c5147613fab28678b206aeb7c7e diff --git a/js/formateur.js b/js/formateur.js index b7ec0eb..1cc88c2 100644 --- a/js/formateur.js +++ b/js/formateur.js @@ -28,7 +28,7 @@ euphorik.Formateur = function() { this.regexUrl = new RegExp("(?:(?:" + this.protocoles + ")://|www\\.)[^ ]*", "gi"); this.regexImg = new RegExp("^.*?\\.(gif|jpg|png|jpeg|bmp|tiff)$", "i"); - this.regexDomaine = new RegExp("^(?:(?:" + this.protocoles + ")://|www\\.).*?([^/.]+\\.[^/.]+)(?:$|/).*$", "i"); + this.regexDomaine = new RegExp("^(?:(?:" + this.protocoles + ")://)(.*?)(?:$|/).*$", "i"); this.regexTestProtocoleExiste = new RegExp("^(?:" + this.protocoles + ")://.*$", "i"); this.regexNomProtocole = new RegExp("^(.*?)://"); }; @@ -110,12 +110,12 @@ euphorik.Formateur.prototype.traiterURL = function(m, pseudo) { */ euphorik.Formateur.prototype.traiterWikiSyntaxe = function(m) { return m.replace( - /_(.*?)_/g, + /(?:^| )_(.*?)_(?:$| )/g, function(texte, capture) { return '' + capture + ''; } ).replace( - /\*(.*?)\*/g, + /(?:^| )\*(.*?)\*(?:$| )/g, function(texte, capture) { return '' + capture + ''; } @@ -124,7 +124,7 @@ euphorik.Formateur.prototype.traiterWikiSyntaxe = function(m) { /** * Renvoie une version courte de l'url. - * par exemple : http://en.wikipedia.org/wiki/Yakov_Smirnoff devient wikipedia.org + * par exemple : http://en.wikipedia.org/wiki/Yakov_Smirnoff devient en.wikipedia.org */ euphorik.Formateur.prototype.getShort = function(url) { var estUneImage = false;