OSDN Git Service

BugTrack/2283 ls2 plugin: Fix heading listing level
authorumorigu <umorigu@gmail.com>
Fri, 27 Oct 2017 15:05:04 +0000 (00:05 +0900)
committerumorigu <umorigu@gmail.com>
Fri, 27 Oct 2017 15:05:04 +0000 (00:05 +0900)
plugin/ls2.inc.php

index 3572b68..3ea84fb 100644 (file)
@@ -153,9 +153,9 @@ function plugin_ls2_get_headings($page, & $params, $level, $include = FALSE)
        foreach (get_source($page) as $line) {
                if ($is_title && preg_match('/^(\*{1,3})/', $line, $matches)) {
                        $id    = make_heading($line);
-                       $level = strlen($matches[1]);
+                       $heading_level = strlen($matches[1]);
                        $id    = PLUGIN_LS2_ANCHOR_PREFIX . $anchor++;
-                       plugin_ls2_list_push($params, $level + strlen($level));
+                       plugin_ls2_list_push($params, $level + $heading_level);
                        array_push($params['result'],
                                '<li><a href="' . $href . $id . '">' . $line . '</a>');
                } else if ($is_include &&