X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=www%2Fplugins-dist%2Ftextwheel%2Ftypographie%2Ffr.php;fp=www%2Fplugins-dist%2Ftextwheel%2Ftypographie%2Ffr.php;h=ddf3f337a2921be5eee29d6ffc7adb0cdd5558fe;hb=122c920eb07e3f665789f8734965b576e6c25515;hp=4de11e3a6fb3ed7df82340777e193b0839a328df;hpb=226942065cd4f604eb464addf45a065c9e5bc916;p=lhc%2Fweb%2Fwww.git diff --git a/www/plugins-dist/textwheel/typographie/fr.php b/www/plugins-dist/textwheel/typographie/fr.php index 4de11e3a..ddf3f337 100644 --- a/www/plugins-dist/textwheel/typographie/fr.php +++ b/www/plugins-dist/textwheel/typographie/fr.php @@ -3,7 +3,7 @@ /***************************************************************************\ * SPIP, Systeme de publication pour l'internet * * * - * Copyright (c) 2001-2013 * + * Copyright (c) 2001-2014 * * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * * * * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * @@ -60,8 +60,13 @@ function typographie_fr($t) { $t = preg_replace(',(&#?[0-9a-z]+)~;,iS', '$1;', $t); } - /* 2 */ - $t = preg_replace('/»| --?,|(?::(?!:)| %)(?:\W|$)/S', '~$0', $t); + /* 2 ; ajout d'insecable */ + $t = preg_replace('/»| --?,|(?::| %)(?:\W|$)/S', '~$0', $t); + + // {»} guillemet en italiques : ne pas doubler l'insecable + $t = str_replace('~{~', '~{', $t); + $t = str_replace('~}~', '}~', $t); + /* 3 */ $t = preg_replace('/[!?][!?\.]*/S', "$pro~$0", $t, -1, $c); @@ -82,7 +87,7 @@ function typographie_fr($t) { $t = str_replace($pro, '', $t); } - $t = preg_replace(',(https?|ftp|mailto)~((://[^"\'\s\[\]\}\)<>]+)~([?]))?,S', '$1$3$4', $t); + $t = preg_replace(',(' ._PROTOCOLES_STD . ')~((://[^"\'\s\[\]\}\)<>]+)~([?]))?,S', '$1$3$4', $t); $t = str_replace('~', ' ', $t); return $t;