dust.js 756 B

12345678910111213141516171819202122232425262728293031
  1. module.exports = function(hljs) {
  2. var EXPRESSION_KEYWORDS = 'if eq ne lt lte gt gte select default math sep';
  3. return {
  4. aliases: ['dst'],
  5. case_insensitive: true,
  6. subLanguage: 'xml',
  7. contains: [
  8. {
  9. className: 'template-tag',
  10. begin: /\{[#\/]/, end: /\}/, illegal: /;/,
  11. contains: [
  12. {
  13. className: 'name',
  14. begin: /[a-zA-Z\.-]+/,
  15. starts: {
  16. endsWithParent: true, relevance: 0,
  17. contains: [
  18. hljs.QUOTE_STRING_MODE
  19. ]
  20. }
  21. }
  22. ]
  23. },
  24. {
  25. className: 'template-variable',
  26. begin: /\{/, end: /\}/, illegal: /;/,
  27. keywords: EXPRESSION_KEYWORDS
  28. }
  29. ]
  30. };
  31. };