[SPIP] ~v3.0.12-->3.0.13
[ptitvelo/web/www.git] / www / plugins-dist / textwheel / typographie / fr.php
index 4de11e3..6075068 100644 (file)
@@ -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('~', '&nbsp;', $t);
 
        return $t;