diff --git a/lib/marked.js b/lib/marked.js index 81c482d41c..ca608845b5 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -135,7 +135,7 @@ block.pedantic = merge({}, block.normal, { function Lexer(options) { this.tokens = []; - this.tokens.links = {}; + this.tokens.links = Object.create(null); this.options = options || marked.defaults; this.rules = block.normal; diff --git a/test/specs/marked/marked-spec.js b/test/specs/marked/marked-spec.js index 5d4d32e91c..bec0b6c88a 100644 --- a/test/specs/marked/marked-spec.js +++ b/test/specs/marked/marked-spec.js @@ -47,6 +47,20 @@ describe('Marked Code spans', function() { }); }); +describe('Marked Links', function() { + var section = 'Links'; + + var shouldPassButFails = []; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + markedSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + describe('Marked Table cells', function() { var section = 'Table cells'; diff --git a/test/specs/marked/marked.json b/test/specs/marked/marked.json index 60c2023827..30658a9884 100644 --- a/test/specs/marked/marked.json +++ b/test/specs/marked/marked.json @@ -52,5 +52,11 @@ "markdown": "|1|2|\n|-|-|\n| |2|", "html": "
12
2
", "example": 9 + }, + { + "section": "Links", + "markdown": "Link: [constructor][].\n\n[constructor]: https://example.org/", + "html": "

Link: constructor.

", + "example": 10 } ]