From b77a227c8d32c113e50824ccbe95a606f7a64487 Mon Sep 17 00:00:00 2001 From: JLuc not dead Date: Thu, 6 May 2021 21:04:11 +0200 Subject: [PATCH] Propositions --- ajuster_intertitres_fonctions.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ajuster_intertitres_fonctions.php b/ajuster_intertitres_fonctions.php index 0ba3370..ee931fb 100644 --- a/ajuster_intertitres_fonctions.php +++ b/ajuster_intertitres_fonctions.php @@ -15,20 +15,21 @@ if (!defined('_ECRIRE_INC_VERSION')) {return;} * @param string ('blockquote') $echappe, ne pas appliquer le traitement au sein de certaines balises HTML. Exemple `blockquote|article|aside|nav|section` **/ function ajuster_intertitres($texte, $decalage_ou_niveau = 1, $echappe = 'blockquote') { - - if (intval($decalage_ou_niveau)) { - $decalage = $decalage_ou_niveau; - } elseif (substr($decalage_ou_niveau, 0, 1) === 'h' and $niveau = intval(substr($decalage_ou_niveau, 1, 1))) { - preg_match_all('#]*)?>(.*),UimsS'; + $preg = ',<('.$echappe.')\b([^>]*)?>(.*),UimsS'; $texte = echappe_html($texte, '', true, $preg); } @@ -50,8 +51,7 @@ function ajuster_intertitres($texte, $decalage_ou_niveau = 1, $echappe = 'blockq while ($ancien_niveau > 0 and $ancien_niveau <= $niveau_max_recherche){ $nouveau_niveau = $ancien_niveau+$decalage; if ($nouveau_niveau > 0) { - $texte = str_replace("