/* 5 */ $chercher_raccourcis[]="/(^|[^{])[{][{][{]\*\*(.*)[}][}][}]($|[^}])/SUms";\r
/* 3 */ $chercher_raccourcis[]="/(^|[^{])[{][{][{]\*(.*)[}][}][}]($|[^}])/SUms";\r
/* 1 */ $chercher_raccourcis[]="/(^|[^{])[{][{][{](.*)[}][}][}]($|[^}])/SUms";\r
- /* 11 */ $chercher_raccourcis[]="/\{(§|§)\{/S"; # § Pour gerer l'unicode aussi !\r
- /* 12 */ $chercher_raccourcis[]="/\}(§|§)\}/S"; # ne pas sauvergarder ce fichier en utf8 !\r
+ /* 11 */ $chercher_raccourcis[]="/\{(�|§)\{/S"; # § Pour gerer l'unicode aussi !\r
+ /* 12 */ $chercher_raccourcis[]="/\}(�|§)\}/S"; # ne pas sauvergarder ce fichier en utf8 !\r
\r
/* 9b */ $remplacer_raccourcis[]="\$1\n\n$debut_intertitre_5\$2$fin_intertitre_5\n\n\$3";\r
/* 9 */ $remplacer_raccourcis[]="\$1\n\n$debut_intertitre_4\$2$fin_intertitre_4\n\n\$3";\r
// ou n est un nombre en intertitres avec des etoiles type {{{* (avec n etoiles)\r
// {1{ sera converti en {{{* ; {2{ sera converti en {{{** ; etc.\r
// Ne faire la recherche que s'il y a au moins un titre ancienne mode a convertir\r
- if (strpos($texte, '{2{')!==false\r
+ if (strpos($texte, '{1{')!==false\r\r
+ OR strpos($texte, '{2{')!==false\r
OR strpos($texte, '{3{')!==false\r
OR strpos($texte, '{4{')!==false\r
OR strpos($texte, '{5{')!==false) {\r
return $texte;\r
}\r
\r
+function typoenluminee_pre_liens($texte) {\r
+ if (!isset($GLOBALS['barre_typo_pas_de_fork_typo']) OR $GLOBALS['barre_typo_pas_de_fork_typo'] === true)\r
+ return $texte;\r
+\r
+ $texte = str_replace('<-->','↔',$texte);\r
+ $texte = str_replace('-->','→',$texte);\r
+\r
+ return $texte;\r
+}\r
\r
function typoenluminee_pre_typo($texte) {\r
if(!$texte) return $texte;\r
$texte = preg_replace('/^-\s+/m','-* ',$texte);\r
}\r
\r
- $texte = str_replace('<-->','↔',$texte);\r
- $texte = str_replace('-->','→',$texte);\r
$texte = str_replace('<--','←',$texte);\r
$texte = str_replace('<==>','⇔',$texte);\r
$texte = str_replace('==>','⇒',$texte);\r
$texte = str_ireplace('(tm)','™',$texte);\r
$texte = str_replace('...','…',$texte);\r
$texte = preg_replace($chercher_raccourcis, $remplacer_raccourcis, $texte);\r
- \r
/*\r
Cas particulier pour le gras\r
Il ne faut pas traiter la mise en gras ici si le texte contient un tableau\r
// Raccourci typographique <sc></sc>\r
$texte = str_replace('<sc>', '<span class="caps">', $texte);\r
$texte = str_replace('</sc>', '</span>', $texte);\r
+ $texte = acronymes_traiter_raccourcis($texte);\r
return $texte;\r
}\r
\r
return $texte;\r
}\r
\r
+// traite les raccourcis de la forme [SNCF|societe nationale...]\r
+// reprise du plugin acronymes\r
+if (!function_exists('acronymes_traiter_raccourcis')) {\r
+ function acronymes_traiter_raccourcis($letexte){\r
+ $pattern="{\[([^\|\]-]+)\|([^\|\]-]+)\]}";\r
+ preg_match_all ($pattern, $letexte, $tagMatches, PREG_SET_ORDER);\r
+ $textMatches = preg_split ($pattern, $letexte);\r
+\r
+ $tag_attr=array();\r
+ foreach ($tagMatches as $key => $value) {\r
+ $tag_attr[]="<acronym title='".texte_backend($value[2])."'>".$value[1]."</acronym>";\r
+ }\r
+ for ($i = 0; $i < count ($textMatches); $i ++) {\r
+ $textMatches [$i] = $textMatches [$i] . $tag_attr [$i];\r
+ }\r
+ return implode ("", $textMatches);\r
+ }\r
+}\r
+\r
+\r
?>
\ No newline at end of file