Skip to content

Commit

Permalink
Ensure that a heading is preceded by a whitespace
Browse files Browse the repository at this point in the history
Currently `#Foo` gets converted to `<h1>Foo</h1>` which is invalid. Only `# Foo` should be converted to  `<h1>Foo</h1>`
  • Loading branch information
jhollingworth committed May 8, 2015
1 parent 91a1f7a commit b0a4fed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var block = {
code: /^( {4}[^\n]+\n*)+/,
fences: noop,
hr: /^( *[-*_]){3,} *(?:\n+|$)/,
heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/,
nptable: noop,
lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
Expand Down

0 comments on commit b0a4fed

Please sign in to comment.