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.4KB

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