From 1f43f5936bb856d317686641a46388030acd8566 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 6 Sep 2014 22:43:18 -0700 Subject: Added anchor to linkDestination regexes. Closes #62. --- js/stmd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/stmd.js b/js/stmd.js index 6895008..9b144da 100755 --- 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); -- cgit v1.2.3