28 lines
1.9 KiB
JavaScript
28 lines
1.9 KiB
JavaScript
/*! `xml` grammar compiled for Highlight.js 11.3.1 */
|
|
(()=>{var e=(()=>{"use strict";return e=>{
|
|
const a=e.regex,n=a.concat(/[A-Z_]/,a.optional(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),s={
|
|
className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},t={begin:/\s/,
|
|
contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]
|
|
},i=e.inherit(t,{begin:/\(/,end:/\)/}),c=e.inherit(e.APOS_STRING_MODE,{
|
|
className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),r={
|
|
endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",
|
|
begin:/[A-Za-z0-9._:-]+/,relevance:0},{begin:/=\s*/,relevance:0,contains:[{
|
|
className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{
|
|
begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{
|
|
name:"HTML, XML",
|
|
aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],
|
|
case_insensitive:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,
|
|
relevance:10,contains:[t,l,c,i,{begin:/\[/,end:/\]/,contains:[{className:"meta",
|
|
begin:/<![a-z]/,end:/>/,contains:[t,i,l,c]}]}]},e.COMMENT(/<!--/,/-->/,{
|
|
relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{
|
|
className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",
|
|
begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[r],starts:{
|
|
end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",
|
|
begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[r],starts:{
|
|
end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{
|
|
className:"tag",begin:/<>|<\/>/},{className:"tag",
|
|
begin:a.concat(/</,a.lookahead(a.concat(n,a.either(/\/>/,/>/,/\s/)))),
|
|
end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:r}]},{
|
|
className:"tag",begin:a.concat(/<\//,a.lookahead(a.concat(n,/>/))),contains:[{
|
|
className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}
|
|
})();hljs.registerLanguage("xml",e)})(); |