php-template.js 911 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. Language: PHP Template
  3. Requires: xml.js, php.js
  4. Author: Josh Goebel <hello@joshgoebel.com>
  5. Website: https://www.php.net
  6. Category: common
  7. */
  8. function phpTemplate(hljs) {
  9. return {
  10. name: "PHP template",
  11. subLanguage: 'xml',
  12. contains: [
  13. {
  14. begin: /<\?(php|=)?/,
  15. end: /\?>/,
  16. subLanguage: 'php',
  17. contains: [
  18. // We don't want the php closing tag ?> to close the PHP block when
  19. // inside any of the following blocks:
  20. {begin: '/\\*', end: '\\*/', skip: true},
  21. {begin: 'b"', end: '"', skip: true},
  22. {begin: 'b\'', end: '\'', skip: true},
  23. hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null, className: null, contains: null, skip: true}),
  24. hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null, className: null, contains: null, skip: true})
  25. ]
  26. }
  27. ]
  28. };
  29. }
  30. module.exports = phpTemplate;