diff --git a/src/showdown.js b/src/showdown.js index 8532dc0..c34695e 100644 --- a/src/showdown.js +++ b/src/showdown.js @@ -361,13 +361,13 @@ var _HashHTMLBlocks = function(text) { \b // word break // attacklab: hack around khtml/pcre bug... [^\r]*? // any number of lines, minimally matching - .* // the matching end tag + // the matching end tag [ \t]* // trailing spaces/tabs (?=\n+) // followed by a newline ) // attacklab: there are sentinel newlines at end of document /gm,function(){...}}; */ - text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|style|section|header|footer|nav|article|aside)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,hashElement); + text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|style|section|header|footer|nav|article|aside)\b[^\r]*?<\/\2>[ \t]*(?=\n+)\n)/gm,hashElement); // Special case just for
. It was easier to make a special case than // to make the other regex more complicated. diff --git a/test/cases/html5-strutural-tags.html b/test/cases/html5-strutural-tags.html index b89207b..5dc9316 100644 --- a/test/cases/html5-strutural-tags.html +++ b/test/cases/html5-strutural-tags.html @@ -9,8 +9,11 @@ -
read me
+
read +me
- +

the end

\ No newline at end of file diff --git a/test/cases/html5-strutural-tags.md b/test/cases/html5-strutural-tags.md index 15a9fbe..640c018 100644 --- a/test/cases/html5-strutural-tags.md +++ b/test/cases/html5-strutural-tags.md @@ -5,7 +5,10 @@ These HTML5 tags should pass through just fine.
head
-
read me
- +
read +me
+ the end \ No newline at end of file