[SPIP] ~maj 3.0.10 --> 3.0.14
[lhc/web/www.git] / www / plugins-dist / textwheel / typographie / fr.php
index 4de11e3..ddf3f33 100644 (file)
@@ -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('~', '&nbsp;', $t);
 
        return $t;