MDL-49807 mod_wiki: section detection regexp fix
authorMarina Glancy <marina@moodle.com>
Wed, 17 Feb 2016 04:29:57 +0000 (12:29 +0800)
committerDavid Monllao <davidm@moodle.com>
Wed, 17 Feb 2016 05:11:10 +0000 (13:11 +0800)
mod/wiki/parser/markups/html.php

index 355c634..fc1545d 100644 (file)
@@ -73,7 +73,7 @@ class html_parser extends nwiki_parser {
 
         $h1 = array("<\s*h{$minheaderlevel}\s*>", "<\/h{$minheaderlevel}>");
 
-        $regex = "/(.*?)({$h1[0]}\s*".preg_quote($header, '/')."\s*{$h1[1]}.*?)((?:\n{$h1[0]}.*)|$)/is";
+        $regex = "/(.*?)({$h1[0]}\s*".preg_quote($header, '/')."\s*{$h1[1]}.*?)((?:{$h1[0]}.*)|$)/is";
         preg_match($regex, $text, $match);
 
         if (!empty($match)) {