修訂 | 90127f2b592180c24d8ee9e8776d967df5bdfb51 (tree) |
---|---|
時間 | 2016-11-08 01:29:24 |
作者 | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2390 Fix #tracker_list with #author metadata
@@ -930,7 +930,7 @@ class Tracker_list | ||
930 | 930 | { |
931 | 931 | if (trim($line) == '') |
932 | 932 | { |
933 | - $source .= $line; | |
933 | + // Ignore empty line | |
934 | 934 | continue; |
935 | 935 | } |
936 | 936 | $this->pipe = ($line{0} == '|' or $line{0} == ':'); |
@@ -943,8 +943,11 @@ class Tracker_list | ||
943 | 943 | function plugin_tracker_get_source($page) |
944 | 944 | { |
945 | 945 | $source = get_source($page); |
946 | - // 見出しの固有ID部を削除 | |
947 | - $source = preg_replace('/^(\*{1,3}.*)\[#[A-Za-z][\w-]+\](.*)$/m','$1$2',$source); | |
948 | - // #freezeを削除 | |
949 | - return preg_replace('/^#freeze\s*$/im', '', $source); | |
946 | + // Delete anchor part of Headings (Example: "*Heading1 [#id] AAA" to "*Heading1 AAA") | |
947 | + $s2 = preg_replace('/^(\*{1,3}.*)\[#[A-Za-z][\w-]+\](.*)$/m','$1$2',$source); | |
948 | + // Delete #freeze | |
949 | + $s3 = preg_replace('/^#freeze\s*$/im', '', $s2); | |
950 | + // Delete #author line | |
951 | + $s4 = preg_replace('/^#author\b[^\r\n]*$/im', '', $s3); | |
952 | + return $s4; | |
950 | 953 | } |