comparer($n, $o)); if ($format == 'diff' or $format == 'apercu') { $out = afficher_para_modifies($out, ($format == 'apercu')); } } return $out; } /** * https://code.spip.net/@afficher_para_modifies * * @param string $texte * @param bool $court * @return string */ function afficher_para_modifies($texte, $court = false) { // Limiter la taille de l'affichage if ($court) { $max = 200; } else { $max = 2000; } $texte_ret = ''; $paras = explode("\n", $texte); for ($i = 0; $i < count($paras) and strlen($texte_ret) < $max; $i++) { if (strpos($paras[$i], '"diff-')) { $texte_ret .= $paras[$i] . "\n\n"; } # if (strlen($texte_ret) > $max) $texte_ret .= '(...)'; } $texte = $texte_ret; return $texte; }