planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

65
node_modules/micromark/lib/tokenize/thematic-break.mjs generated vendored Normal file
View File

@@ -0,0 +1,65 @@
var thematicBreak = {
name: 'thematicBreak',
tokenize: tokenizeThematicBreak
}
export default thematicBreak
import assert from 'assert'
import codes from '../character/codes.mjs'
import markdownLineEnding from '../character/markdown-line-ending.mjs'
import markdownSpace from '../character/markdown-space.mjs'
import constants from '../constant/constants.mjs'
import types from '../constant/types.mjs'
import spaceFactory from './factory-space.mjs'
function tokenizeThematicBreak(effects, ok, nok) {
var size = 0
var marker
return start
function start(code) {
assert(
code === codes.asterisk ||
code === codes.dash ||
code === codes.underscore,
'expected `*`, `-`, or `_`'
)
effects.enter(types.thematicBreak)
marker = code
return atBreak(code)
}
function atBreak(code) {
if (code === marker) {
effects.enter(types.thematicBreakSequence)
return sequence(code)
}
if (markdownSpace(code)) {
return spaceFactory(effects, atBreak, types.whitespace)(code)
}
if (
size < constants.thematicBreakMarkerCountMin ||
(code !== codes.eof && !markdownLineEnding(code))
) {
return nok(code)
}
effects.exit(types.thematicBreak)
return ok(code)
}
function sequence(code) {
if (code === marker) {
effects.consume(code)
size++
return sequence
}
effects.exit(types.thematicBreakSequence)
return atBreak(code)
}
}