UNPKG

el-beeswarm

Version:

<div style="display: flex; padding: 1rem; flex-direction: column; align-items: center; justify-content: center; height: 100vh; text-align: center; display: flex;

35 lines (27 loc) 745 B
'use strict' var markdownLineEnding = require('../character/markdown-line-ending.js') var markdownSpace = require('../character/markdown-space.js') var types = require('../constant/types.js') var factorySpace = require('./factory-space.js') function whitespaceFactory(effects, ok) { var seen return start function start(code) { if (markdownLineEnding(code)) { effects.enter(types.lineEnding) effects.consume(code) effects.exit(types.lineEnding) seen = true return start } if (markdownSpace(code)) { return factorySpace( effects, start, seen ? types.linePrefix : types.lineSuffix )(code) } return ok(code) } } module.exports = whitespaceFactory