l0bsterssg

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

csp.js (797B)


      1 /*
      2 Language: CSP
      3 Description: Content Security Policy definition highlighting
      4 Author: Taras <oxdef@oxdef.info>
      5 Website: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
      6 
      7 vim: ts=2 sw=2 st=2
      8 */
      9 
     10 /** @type LanguageFn */
     11 function csp(hljs) {
     12   return {
     13     name: 'CSP',
     14     case_insensitive: false,
     15     keywords: {
     16       $pattern: '[a-zA-Z][a-zA-Z0-9_-]*',
     17       keyword: 'base-uri child-src connect-src default-src font-src form-action ' +
     18         'frame-ancestors frame-src img-src media-src object-src plugin-types ' +
     19         'report-uri sandbox script-src style-src',
     20     },
     21     contains: [
     22     {
     23       className: 'string',
     24       begin: "'", end: "'"
     25     },
     26     {
     27       className: 'attribute',
     28       begin: '^Content', end: ':', excludeEnd: true,
     29     },
     30     ]
     31   };
     32 }
     33 
     34 module.exports = csp;