2021-03-10 11:35:00 -05:00
|
|
|
hljs.registerLanguage("http",(()=>{"use strict";function e(...e){
|
|
|
|
return e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null;var n
|
2021-11-12 19:45:02 -05:00
|
|
|
})).join("")}return n=>{const a="HTTP/(2|1\\.[01])",s={className:"attribute",
|
2021-03-10 11:35:00 -05:00
|
|
|
begin:e("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{
|
|
|
|
className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}
|
2021-11-12 19:45:02 -05:00
|
|
|
},t=[s,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{
|
2021-03-10 11:35:00 -05:00
|
|
|
name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+a+" \\d{3})",
|
|
|
|
end:/$/,contains:[{className:"meta",begin:a},{className:"number",
|
2021-11-12 19:45:02 -05:00
|
|
|
begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:t}},{
|
2021-03-10 11:35:00 -05:00
|
|
|
begin:"(?=^[A-Z]+ (.*?) "+a+"$)",end:/$/,contains:[{className:"string",
|
|
|
|
begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:a},{
|
2021-11-12 19:45:02 -05:00
|
|
|
className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:t}
|
|
|
|
},n.inherit(s,{relevance:0})]}}})());
|