Skip to content

Commit d94253c

Browse files
authored
Merge pull request #1438 from UziTech/html-new-line-fix
allow html without \n after
2 parents 6eec528 + 42e816c commit d94253c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

lib/marked.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ var block = {
2727
+ '|<![A-Z][\\s\\S]*?>\\n*' // (4)
2828
+ '|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*' // (5)
2929
+ '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)' // (6)
30-
+ '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag
31-
+ '|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag
30+
+ '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag
31+
+ '|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag
3232
+ ')',
3333
def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
3434
table: noop,

test/new/html_no_new_line.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<img src='sdfg'>

test/new/html_no_new_line.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<img src='sdfg'>

0 commit comments

Comments
 (0)