X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;ds=inline;f=js%2Fformateur.js;h=8fd8e0f766b4384811d80e5df0bcc693db8a7f27;hb=db8db2032070c709d3ac2bfa80dbedaaa84f4556;hp=34b108bbcaa699b211cd0d9c2f217875cc447f87;hpb=7fb422d6d4a7a59c8f74d938371a4a10474e8ea4;p=euphorik.git
diff --git a/js/formateur.js b/js/formateur.js
index 34b108b..8fd8e0f 100644
--- a/js/formateur.js
+++ b/js/formateur.js
@@ -16,8 +16,6 @@
// You should have received a copy of the GNU General Public License
// along with Euphorik. If not, see .
-/*jslint laxbreak:true */
-
/**
* Classe permettant de formater du texte par exemple pour la substitution des liens dans les
@@ -46,7 +44,7 @@ euphorik.Formateur.prototype.filtrerInputPseudo = function(pseudo) {
euphorik.Formateur.prototype.getSmilesHTML = function() {
var XHTML = "";
- this.smiles.each(function(nom) {
+ objectEach(this.smiles, function(nom) {
XHTML += "";
});
return XHTML;
@@ -81,7 +79,7 @@ euphorik.Formateur.prototype.traiterLiensConv = function(m) {
* moyenne sur échantillon : 234ms
*/
euphorik.Formateur.prototype.traiterSmiles = function(m) {
- this.smiles.each(function(nom, smiles) {
+ objectEach(this.smiles, function(nom, smiles) {
for (var i = 0; i < smiles.length; i++) {
m = m.replace(smiles[i], "");
}
@@ -107,19 +105,19 @@ euphorik.Formateur.prototype.traiterURL = function(m, pseudo) {
};
/**
- * Formatage en utilisant un sous-ensemble des règles de mediwiki.
- * par exemple ''italic'' devient italic
+ * Formatage en utilisant un sous-ensemble des règles de Textile : http://en.wikipedia.org/wiki/Textile_(markup_language).
+ * par exemple _italic_ devient italic.
*/
euphorik.Formateur.prototype.traiterWikiSyntaxe = function(m) {
return m.replace(
- /'''(.*?)'''/g,
+ /_(.*?)_/g,
function(texte, capture) {
- return "" + capture + "";
+ return '' + capture + '';
}
).replace(
- /''(.*?)''/g,
+ /\*(.*?)\*/g,
function(texte, capture) {
- return "" + capture + "";
+ return '' + capture + '';
}
);
};
@@ -160,7 +158,7 @@ euphorik.Formateur.prototype.getShort = function(url) {
euphorik.Formateur.prototype.traiterPourFenetreLightBox = function(M, urlCourante) {
var thisFormateur = this;
var traitementUrl = function(url) {
- return "[" + thisFormateur.getShort(url)[0] + (urlCourante == url ? "*" : "") + "]";
+ return "[" + thisFormateur.getShort(url)[0] + (urlCourante === url ? "*" : "") + "]";
};
return this.remplacerBalisesHTML(M).replace(this.regexUrl, traitementUrl);