Urara-Blog/node_modules/.pnpm-store/v3/files/19/eb636f22819c5280326b0aebbeac58de5ab6f9e183c193bc1133c55f2e5884d0d74b3ca9269573423cd442c5418b49050f0027ec7685714f930a0015e0c39d
2022-08-14 01:14:53 +08:00

43 lines
1.1 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @typedef {import('micromark-util-types').Construct} Construct
* @typedef {import('micromark-util-types').Tokenizer} Tokenizer
* @typedef {import('micromark-util-types').State} State
*/
import {labelEnd} from './label-end.js'
/** @type {Construct} */
export const labelStartLink = {
name: 'labelStartLink',
tokenize: tokenizeLabelStartLink,
resolveAll: labelEnd.resolveAll
}
/** @type {Tokenizer} */
function tokenizeLabelStartLink(effects, ok, nok) {
const self = this
return start
/** @type {State} */
function start(code) {
effects.enter('labelLink')
effects.enter('labelMarker')
effects.consume(code)
effects.exit('labelMarker')
effects.exit('labelLink')
return after
}
/** @type {State} */
function after(code) {
/* To do: remove in the future once weve switched from
* `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
* which doesnt need this */
/* Hidden footnotes hook. */
/* c8 ignore next 3 */
return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs
? nok(code)
: ok(code)
}
}