Skip to content

Commit b0a4fed

Browse files
committed
Ensure that a heading is preceded by a whitespace
Currently `#Foo` gets converted to `<h1>Foo</h1>` which is invalid. Only `# Foo` should be converted to `<h1>Foo</h1>`
1 parent 91a1f7a commit b0a4fed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/marked.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var block = {
1515
code: /^( {4}[^\n]+\n*)+/,
1616
fences: noop,
1717
hr: /^( *[-*_]){3,} *(?:\n+|$)/,
18-
heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
18+
heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/,
1919
nptable: noop,
2020
lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
2121
blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,

0 commit comments

Comments
 (0)