diff --git a/Parsedown.php b/Parsedown.php index 308da63..8d6ce06 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -205,7 +205,7 @@ class Parsedown # Setext Header (---) - if ($element['type'] === 'p' and preg_match('/^[-]+[ ]*$/', $line)) + if ($element['type'] === 'p' and ! isset($element['interrupted']) and preg_match('/^[-]+[ ]*$/', $line)) { $element['type'] = 'h.'; $element['level'] = 2; @@ -315,7 +315,7 @@ class Parsedown # Setext Header (===) - if ($element['type'] === 'p' and preg_match('/^[=]+[ ]*$/', $line)) + if ($element['type'] === 'p' and ! isset($element['interrupted']) and preg_match('/^[=]+[ ]*$/', $line)) { $element['type'] = 'h.'; $element['level'] = 1; diff --git a/tests/data/setext.html b/tests/data/setext.html deleted file mode 100644 index 0b00bb3..0000000 --- a/tests/data/setext.html +++ /dev/null @@ -1,2 +0,0 @@ -
not a header
+