diff --git a/Parsedown.php b/Parsedown.php index a109451..e9a8cbd 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -279,7 +279,7 @@ class Parsedown $Block = array( 'element' => array( - 'name' => 'h'.$level, + 'name' => 'h' . min(6, $level), 'text' => $text, 'handler' => 'line', ), diff --git a/test/data/atx_heading.html b/test/data/atx_heading.html index 22d865d..3ab3fd5 100644 --- a/test/data/atx_heading.html +++ b/test/data/atx_heading.html @@ -4,5 +4,6 @@

h4

h5
h6
+
h6

closed h1

#

\ No newline at end of file diff --git a/test/data/atx_heading.md b/test/data/atx_heading.md index 039baaa..5339a5b 100644 --- a/test/data/atx_heading.md +++ b/test/data/atx_heading.md @@ -10,6 +10,8 @@ ###### h6 +####### h6 + # closed h1 # # \ No newline at end of file