dust.js 896 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. Language: Dust
  3. Requires: xml.js
  4. Author: Michael Allen <[email protected]>
  5. Description: Matcher for dust.js templates.
  6. Category: template
  7. */
  8. function(hljs) {
  9. var EXPRESSION_KEYWORDS = 'if eq ne lt lte gt gte select default math sep';
  10. return {
  11. aliases: ['dst'],
  12. case_insensitive: true,
  13. subLanguage: 'xml',
  14. contains: [
  15. {
  16. className: 'template-tag',
  17. begin: /\{[#\/]/, end: /\}/, illegal: /;/,
  18. contains: [
  19. {
  20. className: 'name',
  21. begin: /[a-zA-Z\.-]+/,
  22. starts: {
  23. endsWithParent: true, relevance: 0,
  24. contains: [
  25. hljs.QUOTE_STRING_MODE
  26. ]
  27. }
  28. }
  29. ]
  30. },
  31. {
  32. className: 'template-variable',
  33. begin: /\{/, end: /\}/, illegal: /;/,
  34. keywords: EXPRESSION_KEYWORDS
  35. }
  36. ]
  37. };
  38. }