cmark

My personal build of CMark ✏️

Commit
1f43f5936bb856d317686641a46388030acd8566
Parent
b0fa8e0aa806e61a93649d9245f63e84b4c41a1d
Author
John MacFarlane <fiddlosopher@gmail.com>
Date

Added anchor to linkDestination regexes.

Closes #62.

Diffstat

1 file changed, 2 insertions, 2 deletions

Status File Name N° Changes Insertions Deletions
Modified js/stmd.js 4 2 2
diff --git a/js/stmd.js b/js/stmd.js
@@ -54,10 +54,10 @@ var reLinkTitle = new RegExp(
     '\\((' + ESCAPED_CHAR + '|[^)\\x00])*\\))');
 
 var reLinkDestinationBraces = new RegExp(
-    '[<](?:[^<>\\n\\\\\\x00]' + '|' + ESCAPED_CHAR + '|' + '\\\\)*[>]');
+    '^(?:[<](?:[^<>\\n\\\\\\x00]' + '|' + ESCAPED_CHAR + '|' + '\\\\)*[>])');
 
 var reLinkDestination = new RegExp(
-    '(?:' + REG_CHAR + '+|' + ESCAPED_CHAR + '|' + IN_PARENS_NOSP + ')*');
+    '^(?:' + REG_CHAR + '+|' + ESCAPED_CHAR + '|' + IN_PARENS_NOSP + ')*');
 
 var reEscapable = new RegExp(ESCAPABLE);