Browse Source

Disallow empty reference labels

pull/124/head
Alex Kocharin 10 years ago
parent
commit
86fd73fcba
  1. 7
      lib/rules_block/reference.js

7
lib/rules_block/reference.js

@ -149,11 +149,16 @@ module.exports = function reference(state, startLine, _endLine, silent) {
return false;
}
label = normalizeReference(str.slice(1, labelEnd));
if (!label) {
// CommonMark 0.20 disallows empty labels
return false;
}
// Reference can not terminate anything. This check is for safety only.
/*istanbul ignore if*/
if (silent) { return true; }
label = normalizeReference(str.slice(1, labelEnd));
if (typeof state.env.references === 'undefined') {
state.env.references = {};
}

Loading…
Cancel
Save