prism-code-editor
Version:
Lightweight, extensible code editor component for the web using Prism
33 lines (32 loc) • 825 B
JavaScript
//#region src/prism/utils/xml-shared.js
var entity = [{
pattern: /&[a-z\d]{1,8};/i,
alias: "named-entity"
}, /&#x?[a-f\d]{1,8};/i];
var xmlComment = /<!--(?:(?!<!--)[^])*?-->/g;
var tag = {
pattern: /<\/?(?!\d)[^\s/=>$<%]+(?:\s(?:\s*[^\s/=>]+(?:\s*=\s*(?!\s)(?:"[^"]*"|'[^']*'|[^\s"'=>]+(?=[\s>]))?|(?=[\s/>])))+)?\s*\/?>/g,
inside: {
"punctuation": /^<\/?|\/?>$/,
"tag": {
pattern: /^\S+/,
inside: { "namespace": /^[^:]+:/ }
},
"attr-value": [{
pattern: /(=\s*)(?:"[^"]*"|'[^']*'|[^\s"'>]+)/g,
lookbehind: true,
inside: {
"punctuation": /^["']|["']$/g,
entity
}
}],
"attr-equals": /=/,
"attr-name": {
pattern: /\S+/,
inside: { "namespace": /^[^:]+:/ }
}
}
};
//#endregion
export { tag as n, xmlComment as r, entity as t };
//# sourceMappingURL=xml-shared-BvyhLOaL.js.map