修订版 | 68928cfb62fabc846eadf382d49d81a84627dc87 (tree) |
---|---|
时间 | 2017-10-28 00:05:04 |
作者 | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2283 ls2 plugin: Fix heading listing level
@@ -153,9 +153,9 @@ function plugin_ls2_get_headings($page, & $params, $level, $include = FALSE) | ||
153 | 153 | foreach (get_source($page) as $line) { |
154 | 154 | if ($is_title && preg_match('/^(\*{1,3})/', $line, $matches)) { |
155 | 155 | $id = make_heading($line); |
156 | - $level = strlen($matches[1]); | |
156 | + $heading_level = strlen($matches[1]); | |
157 | 157 | $id = PLUGIN_LS2_ANCHOR_PREFIX . $anchor++; |
158 | - plugin_ls2_list_push($params, $level + strlen($level)); | |
158 | + plugin_ls2_list_push($params, $level + $heading_level); | |
159 | 159 | array_push($params['result'], |
160 | 160 | '<li><a href="' . $href . $id . '">' . $line . '</a>'); |
161 | 161 | } else if ($is_include && |