Browse Source

Complement : eviter d'avoir un espace vide en debut de l'attribut class + vider l'attribut si il y a plus de class (erational)

pull/127/head
Cerdic 2 months ago
parent
commit
be10ed9dd5
  1. 9
      ecrire/inc/filtres.php

9
ecrire/inc/filtres.php

@ -2060,13 +2060,18 @@ function modifier_class($balise, $class, $operation='ajouter') {
}
elseif (in_array($operation, ['supprimer', 'commuter'])
and $is_class_presente) {
$class_new = rtrim(preg_replace("/(^|\s)".preg_quote($c)."($|\s)/", "\\1", $class_new));
$class_new = trim(preg_replace("/(^|\s)".preg_quote($c)."($|\s)/", "\\1", $class_new));
}
}
}
if ($class_new !== $class_courante) {
$balise = inserer_attribut($balise, 'class', $class_new);
if (strlen($class_new)) {
$balise = inserer_attribut($balise, 'class', $class_new);
}
elseif ($class_courante) {
$balise = vider_attribut($balise, 'class');
}
}
}

Loading…
Cancel
Save