1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Support #hashtag per CommonMark and GFM specs

This commit is contained in:
Nathan Baulch 2018-03-29 22:10:30 +11:00 committed by Aidan Woods
parent 68736f8800
commit 8a90586218
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
3 changed files with 13 additions and 2 deletions

View File

@ -519,6 +519,11 @@ class Parsedown
} }
$text = trim($Line['text'], '#'); $text = trim($Line['text'], '#');
if (!isset($text[0]) or $text[0] !== ' ') {
return;
}
$text = trim($text, ' '); $text = trim($text, ' ');
$Block = array( $Block = array(

View File

@ -7,5 +7,7 @@
<p>####### not a heading</p> <p>####### not a heading</p>
<h1>closed h1</h1> <h1>closed h1</h1>
<p>#</p> <p>#</p>
<p>##</p>
<h1># of levels</h1> <h1># of levels</h1>
<h1># of levels #</h1> <h1># of levels #</h1>
<p>#hashtag</p>

View File

@ -16,6 +16,10 @@
# #
##
# # of levels # # of levels
# # of levels # # # # of levels # #
#hashtag