Merge branch '5.2' into 5.3
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / js / 3rdParty / prism / components / prism-csp.js
1 define(["prism/prism"], function () {
2 /**
3 * Original by Scott Helme.
4 *
5 * Reference: https://scotthelme.co.uk/csp-cheat-sheet/
6 *
7 * Supports the following:
8 * - CSP Level 1
9 * - CSP Level 2
10 * - CSP Level 3
11 */
12
13 Prism.languages.csp = {
14 'directive': {
15 pattern: /\b(?:base-uri|block-all-mixed-content|(?:child|connect|default|font|frame|img|manifest|media|object|script|style|worker)-src|disown-opener|form-action|frame-ancestors|plugin-types|referrer|reflected-xss|report-to|report-uri|require-sri-for|sandbox|upgrade-insecure-requests)\b/i,
16 alias: 'keyword'
17 },
18 'safe': {
19 pattern: /'(?:self|none|strict-dynamic|(?:nonce-|sha(?:256|384|512)-)[a-zA-Z\d+=/]+)'/,
20 alias: 'selector'
21 },
22 'unsafe': {
23 pattern: /(?:'unsafe-inline'|'unsafe-eval'|'unsafe-hashed-attributes'|\*)/,
24 alias: 'function'
25 }
26 };
27 return Prism; })