function sommaire_id_ancre_ex($index, &$titre, $hn) { // traiter le format {{{Mon titre}}} (ou alt='Mon titre<mon_ancre>') if(preg_match(',<(\w+)>$,', $titre, $r) || preg_match(',<(\w+)>(?=\'),', $titre, $r)) { $titre = str_replace($r[0], '', $titre); return $r[1]; } $a = strtolower(translitteration(sommaire_nettoyer_titre($titre))); $a = trim(preg_replace(',[^a-z0-9_]+,', '_', $a), '_'); return strlen($a)>2?$a:"sommaire_$index"; }