aboutsummaryrefslogtreecommitdiff
path: root/w/fn
diff options
context:
space:
mode:
Diffstat (limited to 'w/fn')
-rw-r--r--w/fn/w.fn.php37
1 files changed, 1 insertions, 36 deletions
diff --git a/w/fn/w.fn.php b/w/fn/w.fn.php
index fe3ea48..558ae67 100644
--- a/w/fn/w.fn.php
+++ b/w/fn/w.fn.php
@@ -135,42 +135,7 @@ function str_clean(string $string)
return str_replace(' ', '_', strtolower(strip_tags($string)));
}
-function sumparser($text)
-{
- preg_match_all('#<h([1-6]) id="(\w+)">(.+)</h[1-6]>#iU', $text, $out);
-
-
- $sum = [];
- foreach ($out[2] as $key => $value) {
- $sum[$value][$out[1][$key]] = $out[3][$key];
- }
-
-
- $sumstring = '';
- $last = 0;
- foreach ($sum as $title => $list) {
- foreach ($list as $h => $link) {
- if($h > $last) {
- for ($i = 1; $i <= ($h - $last); $i++) {
- $sumstring .= '<ul>';
- }
- $sumstring .= '<li><a href="#'.$title.'">'.$link.'</a></li>' ;
- } elseif ($h < $last) {
- for ($i = 1; $i <= ($last - $h); $i++) {
- $sumstring .= '</ul>';
- }
- $sumstring .= '<li><a href="#'.$title.'">'.$link.'</a></li>' ;
- } elseif ($h = $last) {
- $sumstring .= '<li><a href="#'.$title.'">'.$link.'</a></li>' ;
- }
- $last = $h;
- }
- }
- for ($i = 1; $i <= ($last); $i++) {
- $sumstring .= '</ul>';
- }
- return $sumstring;
-}
+
?> \ No newline at end of file