1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/highlight.js/lib/languages/csp.js

38 lines
834 B
JavaScript
Raw Normal View History

2024-01-16 21:26:16 +08:00
/*
Language: CSP
Description: Content Security Policy definition highlighting
Author: Taras <oxdef@oxdef.info>
Website: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
vim: ts=2 sw=2 st=2
*/
/** @type LanguageFn */
function csp(hljs) {
2023-12-18 13:12:25 +08:00
return {
2024-01-16 21:26:16 +08:00
name: 'CSP',
2023-12-18 13:12:25 +08:00
case_insensitive: false,
keywords: {
2024-01-16 21:26:16 +08:00
$pattern: '[a-zA-Z][a-zA-Z0-9_-]*',
keyword: 'base-uri child-src connect-src default-src font-src form-action ' +
'frame-ancestors frame-src img-src media-src object-src plugin-types ' +
'report-uri sandbox script-src style-src'
2023-12-18 13:12:25 +08:00
},
contains: [
2024-01-16 21:26:16 +08:00
{
className: 'string',
begin: "'",
end: "'"
},
{
className: 'attribute',
begin: '^Content',
end: ':',
excludeEnd: true
}
2023-12-18 13:12:25 +08:00
]
};
2024-01-16 21:26:16 +08:00
}
module.exports = csp;