Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

factory-whitespace.js 684B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict'
  2. var markdownLineEnding = require('../character/markdown-line-ending.js')
  3. var markdownSpace = require('../character/markdown-space.js')
  4. var factorySpace = require('./factory-space.js')
  5. function whitespaceFactory(effects, ok) {
  6. var seen
  7. return start
  8. function start(code) {
  9. if (markdownLineEnding(code)) {
  10. effects.enter('lineEnding')
  11. effects.consume(code)
  12. effects.exit('lineEnding')
  13. seen = true
  14. return start
  15. }
  16. if (markdownSpace(code)) {
  17. return factorySpace(
  18. effects,
  19. start,
  20. seen ? 'linePrefix' : 'lineSuffix'
  21. )(code)
  22. }
  23. return ok(code)
  24. }
  25. }
  26. module.exports = whitespaceFactory