mindoc/static/editor.md/lib/highlight/languages/csp.js
lifei6671 327d6fb8d8 feat:1、修复无数据时报错的问题。
2、新增自定义代码着色格式
3、新增自动加载配置文件
2018-08-07 17:19:56 +08:00

30 lines
665 B
Go

/*
Language: CSP
Description: Content Security Policy definition highlighting
Author: Taras <oxdef@oxdef.info>
vim: ts=2 sw=2 st=2
*/
function(hljs) {
return {
case_insensitive: false,
lexemes: '[a-zA-Z][a-zA-Z0-9_-]*',
keywords: {
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',
},
contains: [
{
className: 'string',
begin: "'", end: "'"
},
{
className: 'attribute',
begin: '^Content', end: ':', excludeEnd: true,
},
]
};
}