Skip to content

Commit 65ee0bf

Browse files
authored
Added Properties-syntax of highlight.js and configured it for the parameters-tab. (#90)
1 parent 906d0cd commit 65ee0bf

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

lib/highlight.min.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,16 @@ contains:s}},{begin:"(?=^[A-Z]+ (.*?) "+n+"$)",end:/$/,contains:[{
319319
className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{
320320
className:"meta",begin:n},{className:"keyword",begin:"[A-Z]+"}],starts:{
321321
end:/\b\B/,illegal:/\S/,contains:s}},e.inherit(a,{relevance:0})]}}})()
322-
;hljs.registerLanguage("http",e)})();/*! `xml` grammar compiled for Highlight.js 11.9.0 */
322+
;hljs.registerLanguage("http",e)})();/*! `properties` grammar compiled for Highlight.js 11.9.0 */
323+
(()=>{var e=(()=>{"use strict";return e=>{
324+
const n="[ \\t\\f]*",t=n+"[:=]"+n,s="[ \\t\\f]+",a="([^\\\\:= \\t\\f\\n]|\\\\.)+",r={
325+
end:"("+t+"|"+s+")",relevance:0,starts:{className:"string",end:/$/,relevance:0,
326+
contains:[{begin:"\\\\\\\\"},{begin:"\\\\\\n"}]}};return{name:".properties",
327+
disableAutodetect:!0,case_insensitive:!0,illegal:/\S/,
328+
contains:[e.COMMENT("^\\s*[!#]","$"),{returnBegin:!0,variants:[{begin:a+t},{
329+
begin:a+s}],contains:[{className:"attr",begin:a,endsParent:!0}],starts:r},{
330+
className:"attr",begin:a+n+"$"}]}}})();hljs.registerLanguage("properties",e)
331+
})();/*! `xml` grammar compiled for Highlight.js 11.9.0 */
323332
(()=>{var e=(()=>{"use strict";return e=>{
324333
const a=e.regex,n=a.concat(/[\p{L}_]/u,a.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s={
325334
className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},t={begin:/\s/,

src/ui.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,12 @@ ui = {
185185

186186
highlightContent: () => {
187187
const getSyntaxHighlightingClass = tab => {
188-
let tabName = tab ? tab.href.split('#')[1] : "n/a";
189-
if (tabName === "HTTP" || tabName === "Parameters") {
190-
return "HTTP";
191-
} else {
192-
return "XML";
193-
}
188+
const tabName = tab ? tab.href.split('#')[1] : 'n/a';
189+
return {
190+
'HTTP': 'HTTP',
191+
'Parameters': 'Properties',
192+
'SAML': 'XML'
193+
}[tabName];
194194
};
195195

196196
const removeSyntaxHighlightingClasses = block => {

0 commit comments

Comments
 (0)