From e51bca64b84202dfe022880852c35312694ddcd1 Mon Sep 17 00:00:00 2001 From: Mateus Craveiro Date: Thu, 20 Dec 2018 01:09:33 -0200 Subject: [PATCH] Fix tag escaping --- lib/marked.js | 2 +- test/new/escaped_angles.html | 2 +- test/original/backslash_escapes.html | 2 +- test/specs/commonmark/commonmark-spec.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 15ad63bfe7..eabf99eedb 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -691,7 +691,7 @@ InlineLexer.prototype.output = function(src) { // escape if (cap = this.rules.escape.exec(src)) { src = src.substring(cap[0].length); - out += cap[1]; + out += escape(cap[1]); continue; } diff --git a/test/new/escaped_angles.html b/test/new/escaped_angles.html index 7cf47c49ee..aa3e73a465 100644 --- a/test/new/escaped_angles.html +++ b/test/new/escaped_angles.html @@ -1 +1 @@ -

>

+

>

diff --git a/test/original/backslash_escapes.html b/test/original/backslash_escapes.html index 29870dac5d..7241d11fa4 100644 --- a/test/original/backslash_escapes.html +++ b/test/original/backslash_escapes.html @@ -20,7 +20,7 @@

Right paren: )

-

Greater-than: >

+

Greater-than: >

Hash: #

diff --git a/test/specs/commonmark/commonmark-spec.js b/test/specs/commonmark/commonmark-spec.js index 5b62131134..4d3550dae1 100644 --- a/test/specs/commonmark/commonmark-spec.js +++ b/test/specs/commonmark/commonmark-spec.js @@ -293,7 +293,7 @@ describe('CommonMark 0.28 Backslash escapes', function() { var section = 'Backslash escapes'; // var shouldPassButFails = []; - var shouldPassButFails = [291, 300, 301]; + var shouldPassButFails = [300, 301]; var willNotBeAttemptedByCoreTeam = [];