l0bsterssg

node.js static responsive blog post generator
Log | Files | Refs | README

php-template.js (911B)


      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 
      9 function phpTemplate(hljs) {
     10   return {
     11     name: "PHP template",
     12     subLanguage: 'xml',
     13     contains: [
     14       {
     15         begin: /<\?(php|=)?/,
     16         end: /\?>/,
     17         subLanguage: 'php',
     18         contains: [
     19           // We don't want the php closing tag ?> to close the PHP block when
     20           // inside any of the following blocks:
     21           {begin: '/\\*', end: '\\*/', skip: true},
     22           {begin: 'b"', end: '"', skip: true},
     23           {begin: 'b\'', end: '\'', skip: true},
     24           hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null, className: null, contains: null, skip: true}),
     25           hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null, className: null, contains: null, skip: true})
     26         ]
     27       }
     28     ]
     29   };
     30 }
     31 
     32 module.exports = phpTemplate;