summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-09-08 09:21:07 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-09-11 11:17:40 -0700
commita407869dfc062d6ec24f00482aae6019e083d8c7 (patch)
treeba579f765c958a1506e37c004b95476e21770251
parent2f718ac9a7e314ae1e195e040664b7478e93416d (diff)
Fixed rewind on parseLabel.
14 test failures now, all with emphasis. IN most of all of these cases, the examples in the spec seem to be mistakes, given what the spec says. More troubling, performance is down from around 220 to 83. This needs investigation.
-rwxr-xr-xjs/stmd.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/stmd.js b/js/stmd.js
index 8fc7f20..7d0a532 100755
--- a/js/stmd.js
+++ b/js/stmd.js
@@ -456,7 +456,7 @@ var parseLink = function() {
n = this.parseLinkLabel();
if (n === 0) {
- return 0;
+ return null;
}
var afterlabel = this.pos;
var rawlabel = this.subject.substr(startpos, n);
@@ -479,7 +479,7 @@ var parseLink = function() {
label: parseRawLabel(rawlabel) };
} else {
this.pos = startpos;
- return 0;
+ return null;
}
}
// If we're here, it wasn't an explicit link. Try to parse a reference link.
@@ -505,6 +505,7 @@ var parseLink = function() {
title: link.title,
label: parseRawLabel(rawlabel) };
} else {
+ this.pos = startpos;
return null;
}
// Nothing worked, rewind: