All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
32 lines
613 B
JavaScript
32 lines
613 B
JavaScript
'use strict'
|
|
|
|
var markdownLineEnding = require('../character/markdown-line-ending.js')
|
|
|
|
var hardBreakEscape = {
|
|
name: 'hardBreakEscape',
|
|
tokenize: tokenizeHardBreakEscape
|
|
}
|
|
|
|
function tokenizeHardBreakEscape(effects, ok, nok) {
|
|
return start
|
|
|
|
function start(code) {
|
|
effects.enter('hardBreakEscape')
|
|
effects.enter('escapeMarker')
|
|
effects.consume(code)
|
|
return open
|
|
}
|
|
|
|
function open(code) {
|
|
if (markdownLineEnding(code)) {
|
|
effects.exit('escapeMarker')
|
|
effects.exit('hardBreakEscape')
|
|
return ok(code)
|
|
}
|
|
|
|
return nok(code)
|
|
}
|
|
}
|
|
|
|
module.exports = hardBreakEscape
|