From 0f0b76374808490dd5036cbad1a49afe5b8220fe Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 7 Mar 2019 15:01:17 -0600 Subject: [PATCH 1/4] allow html without \n after --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index e910ed2d0c..27acce7e05 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -27,8 +27,8 @@ var block = { + '|\\n*' // (4) + '|\\n*' // (5) + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) - + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag - + '|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag + + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\n|$)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag + + '|(?=\\n|$)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag + ')', def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noop, From f1089fe3b03a070137b3e43429c5a36662d69cfc Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 12 Mar 2019 13:08:48 -0500 Subject: [PATCH 2/4] add test --- test/new/html_no_new_line.html | 1 + test/new/html_no_new_line.md | 1 + 2 files changed, 2 insertions(+) create mode 100644 test/new/html_no_new_line.html create mode 100644 test/new/html_no_new_line.md diff --git a/test/new/html_no_new_line.html b/test/new/html_no_new_line.html new file mode 100644 index 0000000000..a82e4a1caa --- /dev/null +++ b/test/new/html_no_new_line.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/new/html_no_new_line.md b/test/new/html_no_new_line.md new file mode 100644 index 0000000000..a82e4a1caa --- /dev/null +++ b/test/new/html_no_new_line.md @@ -0,0 +1 @@ + \ No newline at end of file From 246dd3df54b50925802b788f764f4c71e8562bde Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 12 Mar 2019 15:20:46 -0500 Subject: [PATCH 3/4] fix whitespace after tag --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 27acce7e05..2b5130dc46 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -27,8 +27,8 @@ var block = { + '|\\n*' // (4) + '|\\n*' // (5) + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) - + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\n|$)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag - + '|(?=\\n|$)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag + + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*\\n|$)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag + + '|(?=[ \\t]*\\n|$)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag + ')', def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noop, From 42e816c2a260451a9851dbbe6c51f4a4abc2bb56 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 12 Mar 2019 15:23:12 -0500 Subject: [PATCH 4/4] fix again --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 2b5130dc46..9d7c1555f3 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -27,8 +27,8 @@ var block = { + '|\\n*' // (4) + '|\\n*' // (5) + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) - + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*\\n|$)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag - + '|(?=[ \\t]*\\n|$)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag + + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag + + '|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag + ')', def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noop,