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.

link-reference.js 996B

1234567891011121314151617181920212223242526272829303132333435363738
  1. module.exports = linkReference
  2. linkReference.peek = linkReferencePeek
  3. var association = require('../util/association')
  4. var phrasing = require('../util/container-phrasing')
  5. var safe = require('../util/safe')
  6. function linkReference(node, _, context) {
  7. var type = node.referenceType
  8. var exit = context.enter('linkReference')
  9. var subexit = context.enter('label')
  10. var text = phrasing(node, context, {before: '[', after: ']'})
  11. var value = '[' + text + ']'
  12. var reference
  13. var stack
  14. subexit()
  15. // Hide the fact that we’re in phrasing, because escapes don’t work.
  16. stack = context.stack
  17. context.stack = []
  18. subexit = context.enter('reference')
  19. reference = safe(context, association(node), {before: '[', after: ']'})
  20. subexit()
  21. context.stack = stack
  22. exit()
  23. if (type === 'full' || !text || text !== reference) {
  24. value += '[' + reference + ']'
  25. } else if (type !== 'shortcut') {
  26. value += '[]'
  27. }
  28. return value
  29. }
  30. function linkReferencePeek() {
  31. return '['
  32. }