Urara-Blog/node_modules/.pnpm-store/v3/files/ed/9b0c5b994ea262748059ad43a1777ed09bb12fa8ff192c7b7535387d784e5bc491b69d4bd36cdc2d8b73c9d8420f1fdf615c573f61ea5624eb62e31c606204
2022-08-14 01:14:53 +08:00

23 lines
796 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'
import {codes} from 'micromark-util-symbol/codes.js'
import {types} from 'micromark-util-symbol/types.js'
/** @type {Construct} */
export const blankLine = {tokenize: tokenizeBlankLine, partial: true}
/** @type {Tokenizer} */
function tokenizeBlankLine(effects, ok, nok) {
return factorySpace(effects, afterWhitespace, types.linePrefix)
/** @type {State} */
function afterWhitespace(code) {
return code === codes.eof || markdownLineEnding(code) ? ok(code) : nok(code)
}
}