summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-09-06 22:43:18 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-09-06 22:43:18 -0700
commit1f43f5936bb856d317686641a46388030acd8566 (patch)
treeaadc4977cd8f76439866eb6cb6bb6660d7776c19
parentb0fa8e0aa806e61a93649d9245f63e84b4c41a1d (diff)
Added anchor to linkDestination regexes.
Closes #62.
-rwxr-xr-xjs/stmd.js4
1 files changed, 2 insertions, 2 deletions
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);