prism-etlua.js 524 B

1234567891011121314151617181920212223
  1. (function (Prism) {
  2. Prism.languages.etlua = {
  3. 'delimiter': {
  4. pattern: /^<%[-=]?|-?%>$/,
  5. alias: 'punctuation'
  6. },
  7. 'language-lua': {
  8. pattern: /[\s\S]+/,
  9. inside: Prism.languages.lua
  10. }
  11. };
  12. Prism.hooks.add('before-tokenize', function (env) {
  13. var pattern = /<%[\s\S]+?%>/g;
  14. Prism.languages['markup-templating'].buildPlaceholders(env, 'etlua', pattern);
  15. });
  16. Prism.hooks.add('after-tokenize', function (env) {
  17. Prism.languages['markup-templating'].tokenizePlaceholders(env, 'etlua');
  18. });
  19. }(Prism));