@khanacademy/simple-markdown
Advanced tools
Comparing version 0.8.2 to 0.8.3
# @khanacademy/simple-markdown | ||
## 0.8.3 | ||
### Patch Changes | ||
- 3921a385: Error when rule returns incorrect `parse` result | ||
## 0.8.2 | ||
@@ -4,0 +10,0 @@ |
@@ -177,5 +177,4 @@ /* eslint-disable prefer-spread, no-regex-spaces, no-unused-vars, guard-for-in, no-console, no-var */ | ||
throw new Error("`match` must return a capture starting at index 0 " + "(the current parse index). Did you forget a ^ at the " + "start of the RegExp?"); | ||
} // $FlowFixMe | ||
} | ||
var parsed = rule.parse(capture, nestedParse, state); // We maintain the same object here so that rules can | ||
@@ -190,6 +189,10 @@ // store references to the objects they return and | ||
} else { | ||
// We also let rules override the default type of | ||
if (parsed == null || typeof parsed !== "object") { | ||
throw new Error("parse() function returned invalid parse result: '".concat(parsed, "'")); | ||
} // We also let rules override the default type of | ||
// their parsed node if they would like to, so that | ||
// there can be a single output function for all links, | ||
// even if there are several rules to parse them. | ||
if (parsed.type == null) { | ||
@@ -196,0 +199,0 @@ // $FlowFixMe |
@@ -179,5 +179,4 @@ 'use strict'; | ||
throw new Error("`match` must return a capture starting at index 0 " + "(the current parse index). Did you forget a ^ at the " + "start of the RegExp?"); | ||
} // $FlowFixMe | ||
} | ||
var parsed = rule.parse(capture, nestedParse, state); // We maintain the same object here so that rules can | ||
@@ -192,6 +191,10 @@ // store references to the objects they return and | ||
} else { | ||
// We also let rules override the default type of | ||
if (parsed == null || typeof parsed !== "object") { | ||
throw new Error("parse() function returned invalid parse result: '".concat(parsed, "'")); | ||
} // We also let rules override the default type of | ||
// their parsed node if they would like to, so that | ||
// there can be a single output function for all links, | ||
// even if there are several rules to parse them. | ||
if (parsed.type == null) { | ||
@@ -198,0 +201,0 @@ // $FlowFixMe |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "0.8.2", | ||
"version": "0.8.3", | ||
"publishConfig": { | ||
@@ -9,0 +9,0 @@ "access": "public" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
601987
9354
226