summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-http.min.js
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-12-30 19:47:21 +0100
committerArmand Philippot <git@armandphilippot.com>2021-12-30 19:47:21 +0100
commita98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 (patch)
tree542810ab5aef99150db228bb54fd58303dcb31c7 /public/prism/prism-http.min.js
parentab355897a12b7bda1089a44de326d41455a0f7a3 (diff)
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-http.min.js')
-rw-r--r--public/prism/prism-http.min.js103
1 files changed, 103 insertions, 0 deletions
diff --git a/public/prism/prism-http.min.js b/public/prism/prism-http.min.js
new file mode 100644
index 0000000..12c5e3a
--- /dev/null
+++ b/public/prism/prism-http.min.js
@@ -0,0 +1,103 @@
+!(function (t) {
+ function a(t) {
+ return RegExp('(^(?:' + t + '):[ \t]*(?![ \t]))[^]+', 'i');
+ }
+ t.languages.http = {
+ 'request-line': {
+ pattern:
+ /^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m,
+ inside: {
+ method: { pattern: /^[A-Z]+\b/, alias: 'property' },
+ 'request-target': {
+ pattern: /^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,
+ lookbehind: !0,
+ alias: 'url',
+ inside: t.languages.uri,
+ },
+ 'http-version': {
+ pattern: /^(\s)HTTP\/[\d.]+/,
+ lookbehind: !0,
+ alias: 'property',
+ },
+ },
+ },
+ 'response-status': {
+ pattern: /^HTTP\/[\d.]+ \d+ .+/m,
+ inside: {
+ 'http-version': { pattern: /^HTTP\/[\d.]+/, alias: 'property' },
+ 'status-code': {
+ pattern: /^(\s)\d+(?=\s)/,
+ lookbehind: !0,
+ alias: 'number',
+ },
+ 'reason-phrase': {
+ pattern: /^(\s).+/,
+ lookbehind: !0,
+ alias: 'string',
+ },
+ },
+ },
+ header: {
+ pattern: /^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m,
+ inside: {
+ 'header-value': [
+ {
+ pattern: a('Content-Security-Policy'),
+ lookbehind: !0,
+ alias: ['csp', 'languages-csp'],
+ inside: t.languages.csp,
+ },
+ {
+ pattern: a('Public-Key-Pins(?:-Report-Only)?'),
+ lookbehind: !0,
+ alias: ['hpkp', 'languages-hpkp'],
+ inside: t.languages.hpkp,
+ },
+ {
+ pattern: a('Strict-Transport-Security'),
+ lookbehind: !0,
+ alias: ['hsts', 'languages-hsts'],
+ inside: t.languages.hsts,
+ },
+ { pattern: a('[^:]+'), lookbehind: !0 },
+ ],
+ 'header-name': { pattern: /^[^:]+/, alias: 'keyword' },
+ punctuation: /^:/,
+ },
+ },
+ };
+ var e,
+ n,
+ s,
+ i = t.languages,
+ p = {
+ 'application/javascript': i.javascript,
+ 'application/json': i.json || i.javascript,
+ 'application/xml': i.xml,
+ 'text/xml': i.xml,
+ 'text/html': i.html,
+ 'text/css': i.css,
+ 'text/plain': i.plain,
+ },
+ r = { 'application/json': !0, 'application/xml': !0 };
+ for (var l in p)
+ if (p[l]) {
+ e = e || {};
+ var o = r[l]
+ ? (void 0,
+ (s = (n = l).replace(/^[a-z]+\//, '')),
+ '(?:' + n + '|\\w+/(?:[\\w.-]+\\+)+' + s + '(?![+\\w.-]))')
+ : l;
+ e[l.replace(/\//g, '-')] = {
+ pattern: RegExp(
+ '(content-type:\\s*' +
+ o +
+ '(?:(?:\r\n?|\n)[\\w-].*)*(?:\r(?:\n|(?!\n))|\n))[^ \t\\w-][^]*',
+ 'i'
+ ),
+ lookbehind: !0,
+ inside: p[l],
+ };
+ }
+ e && t.languages.insertBefore('http', 'header', e);
+})(Prism);