partial-blank-line.mjs 561 B

123456789101112131415161718
  1. var partialBlankLine = {
  2. tokenize: tokenizePartialBlankLine,
  3. partial: true
  4. }
  5. export default partialBlankLine
  6. import codes from '../character/codes.mjs'
  7. import markdownLineEnding from '../character/markdown-line-ending.mjs'
  8. import types from '../constant/types.mjs'
  9. import spaceFactory from './factory-space.mjs'
  10. function tokenizePartialBlankLine(effects, ok, nok) {
  11. return spaceFactory(effects, afterWhitespace, types.linePrefix)
  12. function afterWhitespace(code) {
  13. return code === codes.eof || markdownLineEnding(code) ? ok(code) : nok(code)
  14. }
  15. }