X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;ds=sidebyside;f=js%2Fformateur.js;h=1cc88c26a541be048b101d5e3b1c6f2a6860f1b3;hb=79f0cfc91b7220d98e4caf50fbb3857807fc6bc4;hp=72ecfad3623cfcac204115a4ebf93b4d3a115bcd;hpb=351623b2a00432ae5b690476c68b8fb05cc8dd03;p=euphorik.git
diff --git a/js/formateur.js b/js/formateur.js
index 72ecfad..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;
@@ -159,7 +159,7 @@ euphorik.Formateur.prototype.supprimerSmiles = function(m) {
}
});
return m;
-}
+};
/**
* Traite les pseudo et messages à être affiché dans le titre d'une image visualisé avec lightbox.