Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Commit fd27f4c

Browse files
committed
fix link references that are reserved words, like [constructor]()
1 parent 50f6d69 commit fd27f4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/markdown.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,7 +1512,7 @@ function convert_tree_to_html( tree, references, options ) {
15121512
jsonml[ 0 ] = "a";
15131513

15141514
// grab this ref and clean up the attribute node
1515-
var ref = references[ attrs.ref ];
1515+
var ref = Object.prototype.hasOwnProperty.call(references, attrs.ref) && references[ attrs.ref ];
15161516

15171517
// if the reference exists, make the link
15181518
if ( ref ) {
@@ -1536,7 +1536,7 @@ function convert_tree_to_html( tree, references, options ) {
15361536
jsonml[ 0 ] = "img";
15371537

15381538
// grab this ref and clean up the attribute node
1539-
var ref = references[ attrs.ref ];
1539+
var ref = Object.prototype.hasOwnProperty.call(references, attrs.ref) && references[ attrs.ref ];
15401540

15411541
// if the reference exists, make the link
15421542
if ( ref ) {

0 commit comments

Comments
 (0)