Sha256: d03f648a6f9fdc3c577ae60c85f174e3ab18ca4f8d7f5052f16c7079e70eca7d
Contents?: true
Size: 1.03 KB
Versions: 23
Compression:
Stored size: 1.03 KB
Contents
'use strict' // A line containing no characters, or a line containing only spaces (U+0020) or // tabs (U+0009), is called a blank line. // See <https://spec.commonmark.org/0.29/#blank-line>. var reBlankLine = /^[ \t]*(\n|$)/ // Note that though blank lines play a special role in lists to determine // whether the list is tight or loose // (<https://spec.commonmark.org/0.29/#blank-lines>), it’s done by the list // tokenizer and this blank line tokenizer does not have to be responsible for // that. // Therefore, configs such as `blankLine.notInList` do not have to be set here. module.exports = blankLine function blankLine(eat, value, silent) { var match var subvalue = '' var index = 0 var length = value.length while (index < length) { match = reBlankLine.exec(value.slice(index)) if (match == null) { break } index += match[0].length subvalue += match[0] } if (subvalue === '') { return } /* istanbul ignore if - never used (yet) */ if (silent) { return true } eat(subvalue) }
Version data entries
23 entries across 23 versions & 1 rubygems