Skip to content

Commit

Permalink
Merge pull request markedjs#1299 from Trott/prototype-chain
Browse files Browse the repository at this point in the history
fix issues link references and prototypes
  • Loading branch information
styfle committed Jun 30, 2018
2 parents ee0a954 + 526cc07 commit 87f5729
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
14 changes: 14 additions & 0 deletions test/specs/marked/marked-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
6 changes: 6 additions & 0 deletions test/specs/marked/marked.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,11 @@
"markdown": "|1|2|\n|-|-|\n| |2|",
"html": "<table><thead><tr><th>1</th><th>2</th></tr></thead><tbody><tr><td></td><td>2</td></tr></tbody></table>",
"example": 9
},
{
"section": "Links",
"markdown": "Link: [constructor][].\n\n[constructor]: https://example.org/",
"html": "<p>Link: <a href=\"https://example.org/\">constructor</a>.</p>",
"example": 10
}
]

0 comments on commit 87f5729

Please sign in to comment.