Files
coopgo/node_modules/micromark/lib/tokenize/line-ending.mjs
sgauthier 6e64e138e2
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
planning
2024-10-14 09:15:30 +02:00

23 lines
585 B
JavaScript

var lineEnding = {
name: 'lineEnding',
tokenize: tokenizeLineEnding
}
export default lineEnding
import assert from 'assert'
import markdownLineEnding from '../character/markdown-line-ending.mjs'
import types from '../constant/types.mjs'
import spaceFactory from './factory-space.mjs'
function tokenizeLineEnding(effects, ok) {
return start
function start(code) {
assert(markdownLineEnding(code), 'expected eol')
effects.enter(types.lineEnding)
effects.consume(code)
effects.exit(types.lineEnding)
return spaceFactory(effects, ok, types.linePrefix)
}
}