]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/http.js
1 /*! `http` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= (function () {
7 Description: HTTP request and response headers with automatic body highlighting
8 Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
9 Category: protocols, web
10 Website: https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
14 const regex
= hljs
.regex
;
15 const VERSION
= 'HTTP/([32]|1\\.[01])';
16 const HEADER_NAME
= /[A-Za-z][A-Za-z0-9-]*/;
18 className: 'attribute',
19 begin: regex
.concat('^', HEADER_NAME
, '(?=\\:\\s)'),
22 className: "punctuation",
32 const HEADERS_AND_BODY
= [
50 begin: '^(?=' + VERSION
+ " \\d{3})",
65 contains: HEADERS_AND_BODY
70 begin: '(?=^[A-Z]+ (.*?) ' + VERSION
+ '$)',
92 contains: HEADERS_AND_BODY
95 // to allow headers to work even without a preamble
96 hljs
.inherit(HEADER
, { relevance: 0 })
105 export default hljsGrammar
;