aboutsummaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorache <ache@ache.one>2020-05-06 04:50:54 +0200
committerache <ache@ache.one>2020-05-06 04:50:54 +0200
commit2f588b24aa37643df6e31d1dc2a072a2aed39495 (patch)
tree9bec26c65cfb24d1ca11f7f5aef1cba8b06cbf4f /dist
parentMore atx header error tests (diff)
Forbid empty atx header
Diffstat (limited to 'dist')
-rw-r--r--dist/index.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/dist/index.js b/dist/index.js
index e4f1105..38e6f1f 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -119,6 +119,11 @@ function tokenizeModifierGenerator(oldParser, config) {
}
index = lastChild.value.lastIndexOf('{');
+
+ if (index <= 0) {
+ return eaten;
+ }
+
var parsedAttr = parseAttr(lastChild.value, index, config.mdAttrConfig);
if (parsedAttr.eaten.length !== lastChild.value.length - index) {
@@ -129,6 +134,10 @@ function tokenizeModifierGenerator(oldParser, config) {
while (index >= 0 && isWhiteSpace(lastChild.value[index])) {
index -= 1;
+ }
+
+ if (index < 0) {
+ return eaten;
} // If parsed configure the node