X-Git-Url: http://git.cyclocoop.org/?p=ptitvelo%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Finc%2Ftexte_mini.php;h=f3c2429dc1336e56a3a0db7a9d92a4382bd2aa4f;hp=cdde1f3df2a1f183ec14eb8f71193567e0fa370c;hb=e847eea4a82a7396dd0abf860f9b30d654f38629;hpb=d686c3e22e97dd46ef42bcd0f138c65083f8f232
diff --git a/www/ecrire/inc/texte_mini.php b/www/ecrire/inc/texte_mini.php
index cdde1f3..f3c2429 100644
--- a/www/ecrire/inc/texte_mini.php
+++ b/www/ecrire/inc/texte_mini.php
@@ -142,7 +142,21 @@ function traiter_echap_script_dist($regs) {
return $regs[0];
}
-define('_PROTEGE_BLOCS', ',<(html|code|cadre|frame|script)(\s[^>]*)?>(.*)\1>,UimsS');
+/**
+ * Traiter les blocs echappes par echappe_html
+ * @param $regs
+ * @return string
+ */
+function traiter_echap_math_dist($regs) {
+ // Gestion du TeX
+ if (!function_exists('traiter_math'))
+ include_spip('inc/math');
+
+ $t = traiter_math($regs[0], '');
+ return $t;
+}
+
+define('_PROTEGE_BLOCS', ',<(html|code|cadre|frame|script|math)(\s[^>]*)?>(.*)\1>,UimsS');
// - pour $source voir commentaire infra (echappe_retour)
// - pour $no_transform voir le filtre post_autobr dans inc/filtres
@@ -163,7 +177,7 @@ $preg='') {
}
if (($preg OR strpos($letexte,"<")!==false)
- AND preg_match_all($preg ? $preg : _PROTEGE_BLOCS, $letexte, $matches, PREG_SET_ORDER))
+ AND preg_match_all($preg ? $preg : _PROTEGE_BLOCS, $letexte, $matches, PREG_SET_ORDER)) {
foreach ($matches as $regs) {
// echappements tels quels ?
if ($no_transform) {
@@ -179,23 +193,34 @@ $preg='') {
$p = strpos($letexte,$regs[0]);
$letexte = substr_replace($letexte,code_echappement($echap, $source, $no_transform),$p,strlen($regs[0]));
}
+ }
if ($no_transform)
return $letexte;
// Gestion du TeX
- if (strpos($letexte, "