Urara-Blog/node_modules/.pnpm-store/v3/files/94/38fbdcd2cedec731d1dba80bf2dbc95eb45b898ce520cf93d7e5cb764e5681f3e67d59241d1f77ac3d905892c5326039f8cdf419eeebedde90936c1670db3d
2022-08-14 01:14:53 +08:00

23 lines
686 B
Text

/**
* @typedef {import('micromark-util-types').Construct} Construct
* @typedef {import('micromark-util-types').Tokenizer} Tokenizer
* @typedef {import('micromark-util-types').State} State
*/
import {factorySpace} from 'micromark-factory-space'
import {markdownLineEnding} from 'micromark-util-character'
/** @type {Construct} */
export const blankLine = {
tokenize: tokenizeBlankLine,
partial: true
}
/** @type {Tokenizer} */
function tokenizeBlankLine(effects, ok, nok) {
return factorySpace(effects, afterWhitespace, 'linePrefix')
/** @type {State} */
function afterWhitespace(code) {
return code === null || markdownLineEnding(code) ? ok(code) : nok(code)
}
}