diff --git a/lib/marked.js b/lib/marked.js index b7969b1d45..0c2ac4b100 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -76,7 +76,8 @@ block.normal = merge({}, block); block.gfm = merge({}, block.normal, { fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, - paragraph: /^/ + paragraph: /^/, + heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ }); block.gfm.paragraph = replace(block.paragraph) diff --git a/test/new/gfm_hashtag.gfm.html b/test/new/gfm_hashtag.gfm.html new file mode 100644 index 0000000000..6f9e43f52d --- /dev/null +++ b/test/new/gfm_hashtag.gfm.html @@ -0,0 +1,5 @@ +

#header

+ +

header1

+ +

header2

diff --git a/test/new/gfm_hashtag.gfm.text b/test/new/gfm_hashtag.gfm.text new file mode 100644 index 0000000000..7656ecfd7c --- /dev/null +++ b/test/new/gfm_hashtag.gfm.text @@ -0,0 +1,5 @@ +#header + +# header1 + +# header2 diff --git a/test/new/gfm_hashtag.nogfm.html b/test/new/gfm_hashtag.nogfm.html new file mode 100644 index 0000000000..ecd95d692e --- /dev/null +++ b/test/new/gfm_hashtag.nogfm.html @@ -0,0 +1,5 @@ +

header

+ +

header1

+ +

header2

diff --git a/test/new/gfm_hashtag.nogfm.text b/test/new/gfm_hashtag.nogfm.text new file mode 100644 index 0000000000..7656ecfd7c --- /dev/null +++ b/test/new/gfm_hashtag.nogfm.text @@ -0,0 +1,5 @@ +#header + +# header1 + +# header2 diff --git a/test/tests/gfm_hashtag.gfm.html b/test/tests/gfm_hashtag.gfm.html new file mode 100644 index 0000000000..6f9e43f52d --- /dev/null +++ b/test/tests/gfm_hashtag.gfm.html @@ -0,0 +1,5 @@ +

#header

+ +

header1

+ +

header2

diff --git a/test/tests/gfm_hashtag.gfm.text b/test/tests/gfm_hashtag.gfm.text new file mode 100644 index 0000000000..7656ecfd7c --- /dev/null +++ b/test/tests/gfm_hashtag.gfm.text @@ -0,0 +1,5 @@ +#header + +# header1 + +# header2 diff --git a/test/tests/gfm_hashtag.nogfm.html b/test/tests/gfm_hashtag.nogfm.html new file mode 100644 index 0000000000..ecd95d692e --- /dev/null +++ b/test/tests/gfm_hashtag.nogfm.html @@ -0,0 +1,5 @@ +

header

+ +

header1

+ +

header2

diff --git a/test/tests/gfm_hashtag.nogfm.text b/test/tests/gfm_hashtag.nogfm.text new file mode 100644 index 0000000000..7656ecfd7c --- /dev/null +++ b/test/tests/gfm_hashtag.nogfm.text @@ -0,0 +1,5 @@ +#header + +# header1 + +# header2