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.

block-quote.js 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. 'use strict'
  2. var codes = require('../character/codes.js')
  3. var markdownSpace = require('../character/markdown-space.js')
  4. var constants = require('../constant/constants.js')
  5. var types = require('../constant/types.js')
  6. var factorySpace = require('./factory-space.js')
  7. var blockQuote = {
  8. name: 'blockQuote',
  9. tokenize: tokenizeBlockQuoteStart,
  10. continuation: {tokenize: tokenizeBlockQuoteContinuation},
  11. exit: exit
  12. }
  13. function tokenizeBlockQuoteStart(effects, ok, nok) {
  14. var self = this
  15. return start
  16. function start(code) {
  17. if (code === codes.greaterThan) {
  18. if (!self.containerState.open) {
  19. effects.enter(types.blockQuote, {_container: true})
  20. self.containerState.open = true
  21. }
  22. effects.enter(types.blockQuotePrefix)
  23. effects.enter(types.blockQuoteMarker)
  24. effects.consume(code)
  25. effects.exit(types.blockQuoteMarker)
  26. return after
  27. }
  28. return nok(code)
  29. }
  30. function after(code) {
  31. if (markdownSpace(code)) {
  32. effects.enter(types.blockQuotePrefixWhitespace)
  33. effects.consume(code)
  34. effects.exit(types.blockQuotePrefixWhitespace)
  35. effects.exit(types.blockQuotePrefix)
  36. return ok
  37. }
  38. effects.exit(types.blockQuotePrefix)
  39. return ok(code)
  40. }
  41. }
  42. function tokenizeBlockQuoteContinuation(effects, ok, nok) {
  43. return factorySpace(
  44. effects,
  45. effects.attempt(blockQuote, ok, nok),
  46. types.linePrefix,
  47. this.parser.constructs.disable.null.indexOf('codeIndented') > -1
  48. ? undefined
  49. : constants.tabSize
  50. )
  51. }
  52. function exit(effects) {
  53. effects.exit(types.blockQuote)
  54. }
  55. module.exports = blockQuote