aboutsummaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js
index 30d216d..e89c3b5 100644
--- a/src/index.js
+++ b/src/index.js
@@ -116,6 +116,10 @@ function tokenizeModifierGenerator(oldParser, config) {
index = lastChild.value.lastIndexOf('{');
+ if (index <= 0) {
+ return eaten;
+ }
+
const parsedAttr = parseAttr(lastChild.value, index, config.mdAttrConfig);
if (parsedAttr.eaten.length !== lastChild.value.length - index) {
@@ -127,6 +131,10 @@ function tokenizeModifierGenerator(oldParser, config) {
index -= 1;
}
+ if (index < 0) {
+ return eaten;
+ }
+
// If parsed configure the node
if (parsedAttr) {
if (config.scope && config.scope !== 'none') {