csp.js 665 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. Language: CSP
  3. Description: Content Security Policy definition highlighting
  4. Author: Taras <[email protected]>
  5. vim: ts=2 sw=2 st=2
  6. */
  7. function(hljs) {
  8. return {
  9. case_insensitive: false,
  10. lexemes: '[a-zA-Z][a-zA-Z0-9_-]*',
  11. keywords: {
  12. keyword: 'base-uri child-src connect-src default-src font-src form-action' +
  13. ' frame-ancestors frame-src img-src media-src object-src plugin-types' +
  14. ' report-uri sandbox script-src style-src',
  15. },
  16. contains: [
  17. {
  18. className: 'string',
  19. begin: "'", end: "'"
  20. },
  21. {
  22. className: 'attribute',
  23. begin: '^Content', end: ':', excludeEnd: true,
  24. },
  25. ]
  26. };
  27. }