diff --git a/src/subParsers/makehtml/encodeAmpsAndAngles.js b/src/subParsers/makehtml/encodeAmpsAndAngles.js index f62ae0c..ca10eb7 100644 --- a/src/subParsers/makehtml/encodeAmpsAndAngles.js +++ b/src/subParsers/makehtml/encodeAmpsAndAngles.js @@ -33,6 +33,9 @@ showdown.subParser('makehtml.encodeAmpsAndAngles', function (text, options, glob // Encode > text = text.replace(/>/g, '>'); + // encode " + text = text.replace(/"/g, '"'); + let afterEvent = new showdown.Event('makehtml.encodeAmpsAndAngles.onEnd', text); afterEvent .setOutput(text) diff --git a/src/subParsers/makehtml/escapeSpecialCharsWithinTagAttributes.js b/src/subParsers/makehtml/escapeSpecialCharsWithinTagAttributes.js index e2447c4..769f839 100644 --- a/src/subParsers/makehtml/escapeSpecialCharsWithinTagAttributes.js +++ b/src/subParsers/makehtml/escapeSpecialCharsWithinTagAttributes.js @@ -22,7 +22,7 @@ showdown.subParser('makehtml.escapeSpecialCharsWithinTagAttributes', function (t text = startEvent.output; // Build a regex to find HTML tags. - let tags = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi, + let tags = /<\/?[a-z\d_:-]+(?:\s+[\s\S]+?)?>/gi, comments = /-]|-[^>])([^-]|-[^-])*)--)>/gi; text = text.replace(tags, function (wholeMatch) { diff --git a/src/subParsers/makehtml/heading.js b/src/subParsers/makehtml/heading.js index d22ee42..8e8a3a9 100644 --- a/src/subParsers/makehtml/heading.js +++ b/src/subParsers/makehtml/heading.js @@ -309,7 +309,7 @@ if (/^¨K\d+K$/.test(nLastLine) || /^\s*$/gm.test(nLastLine)) { // everything before --- or === is a block or empty line, so it's a false positive - prepend += nPrepend; + prepend += nPrepend + '\n\n'; headingText = ''; } else { // the last line is something else... so let's look at the line before that diff --git a/test/functional/makehtml/cases/features/#320.github-compatible-generated-header-id.html b/test/functional/makehtml/cases/features/#320.github-compatible-generated-header-id.html index cea0af8..f0f4c2a 100644 --- a/test/functional/makehtml/cases/features/#320.github-compatible-generated-header-id.html +++ b/test/functional/makehtml/cases/features/#320.github-compatible-generated-header-id.html @@ -1,5 +1,3 @@