@kg-ui/kg-ui-plus 0.1.46 → 0.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/KgCopilot/CopiCanvas/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiCanvas/index.vue2.mjs +4 -5
- package/dist/es/KgCopilot/CopiCanvas/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/CopiCanvas/testWPS.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiCanvas/testWPS.vue2.mjs +51 -0
- package/dist/es/KgCopilot/CopiCanvas/testWPS.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiCanvas/web-office-sdk-solution-v2.0.7.es.mjs +854 -0
- package/dist/es/KgCopilot/CopiFooter/SearchInput/InputFootTool.vue2.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/SearchInput/SelectPluginByKey.vue2.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue2.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/SuggestMessage.vue2.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/messageParse/readMd.vue2.mjs +3 -3
- package/dist/es/KgCopilot/historyRecord/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/historyRecord/index.vue2.mjs +7 -7
- package/dist/es/KgCopilot/historyRecord/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/index.vue2.mjs +8 -5
- package/dist/es/KgCopilot/index.vue3.mjs +2 -2
- package/dist/es/api/copilot.mjs +0 -8
- package/dist/es/directives/heighlight/index.mjs +27 -27
- package/dist/es/home/LFilter/FilterHead.vue.mjs +1 -1
- package/dist/es/node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.2.45/node_modules/@vueuse/core/index.mjs +1 -3
- package/dist/es/node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.2.45/node_modules/@vueuse/shared/index.mjs +1 -52
- package/dist/es/node_modules/.pnpm/{dompurify@3.2.3 → dompurify@3.0.10}/node_modules/dompurify/dist/purify.es.mjs +91 -119
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/apache.mjs +0 -4
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/bash.mjs +2 -20
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/basic.mjs +1 -7
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/c.mjs +4 -19
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/css.mjs +8 -214
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/dart.mjs +2 -10
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/erlang.mjs +6 -48
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/go.mjs +3 -23
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/java.mjs +1 -3
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/javascript.mjs +11 -15
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/json.mjs +0 -1
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/markdown.mjs +1 -7
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/php.mjs +2 -16
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/python.mjs +1 -3
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/ruby.mjs +1 -1
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/stylus.mjs +8 -214
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/swift.mjs +14 -60
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/typescript.mjs +18 -45
- package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/lib/core.mjs +8 -8
- package/dist/es/node_modules/.pnpm/{marked@12.0.2 → marked@12.0.1}/node_modules/marked/lib/marked.esm.mjs +1 -2
- package/dist/es/store/modules/copilot.mjs +8 -2
- package/dist/es/style.css +1 -1
- package/dist/es/utils/http/index.mjs +4 -0
- package/package.json +2 -2
- package/dist/es/KgCopilot/CopiCanvas/FilePreview.vue.mjs +0 -7
- package/dist/es/KgCopilot/CopiCanvas/FilePreview.vue2.mjs +0 -295
- package/dist/es/KgCopilot/CopiCanvas/FilePreview.vue3.mjs +0 -4
- package/dist/es/KgCopilot/CopiCanvas/FileSkeletion.vue.mjs +0 -96
- package/dist/es/KgCopilot/CopiCanvas/FileSkeletion.vue2.mjs +0 -4
- package/dist/es/KgCopilot/CopiCanvas/InitWrap.vue.mjs +0 -7
- package/dist/es/KgCopilot/CopiCanvas/InitWrap.vue2.mjs +0 -41
- package/dist/es/KgCopilot/CopiCanvas/InitWrap.vue3.mjs +0 -4
- package/dist/es/_virtual/_commonjs-dynamic-modules.mjs +0 -6
- package/dist/es/_virtual/jszip.min.mjs +0 -13
- package/dist/es/assets/empty.png.mjs +0 -4
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/folder-opened.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/file-damage-line.mjs +0 -8
- package/dist/es/node_modules/.pnpm/docx-preview@0.3.3/node_modules/docx-preview/dist/docx-preview.mjs +0 -3877
- package/dist/es/node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.mjs +0 -2649
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.12 → @iconify-icons_ep@1.2.7}/node_modules/@iconify-icons/ep/arrow-left.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.12 → @iconify-icons_ep@1.2.7}/node_modules/@iconify-icons/ep/arrow-right.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.12 → @iconify-icons_ep@1.2.7}/node_modules/@iconify-icons/ep/check.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.12 → @iconify-icons_ep@1.2.7}/node_modules/@iconify-icons/ep/close.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.12 → @iconify-icons_ep@1.2.7}/node_modules/@iconify-icons/ep/copy-document.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.12 → @iconify-icons_ep@1.2.7}/node_modules/@iconify-icons/ep/delete.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.12 → @iconify-icons_ep@1.2.7}/node_modules/@iconify-icons/ep/edit.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.12 → @iconify-icons_ep@1.2.7}/node_modules/@iconify-icons/ep/notebook.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.12 → @iconify-icons_ep@1.2.7}/node_modules/@iconify-icons/ep/promotion.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.12 → @iconify-icons_ep@1.2.7}/node_modules/@iconify-icons/ep/reading.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.12 → @iconify-icons_ep@1.2.7}/node_modules/@iconify-icons/ep/search.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/core.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/django.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/dns.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/dos.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/dust.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/http.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/nginx.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/es/languages/xml.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.11.1 → highlight.js@11.9.0}/node_modules/highlight.js/styles/sunburst.css.mjs +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! @license DOMPurify 3.
|
1
|
+
/*! @license DOMPurify 3.0.10 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.10/LICENSE */
|
2
2
|
const {
|
3
3
|
entries,
|
4
4
|
setPrototypeOf,
|
@@ -134,14 +134,14 @@ const svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "
|
|
134
134
|
const mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]);
|
135
135
|
const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
|
136
136
|
const text = freeze(["#text"]);
|
137
|
-
const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "
|
138
|
-
const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "
|
137
|
+
const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]);
|
138
|
+
const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
|
139
139
|
const mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
|
140
140
|
const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
|
141
141
|
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
|
142
142
|
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
143
|
-
const TMPLIT_EXPR = seal(
|
144
|
-
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]
|
143
|
+
const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
|
144
|
+
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/);
|
145
145
|
const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
|
146
146
|
const IS_ALLOWED_URI = seal(
|
147
147
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
@@ -153,37 +153,20 @@ const ATTR_WHITESPACE = seal(
|
|
153
153
|
// eslint-disable-line no-control-regex
|
154
154
|
);
|
155
155
|
const DOCTYPE_NAME = seal(/^html$/i);
|
156
|
-
const CUSTOM_ELEMENT = seal(/^[a-z][
|
156
|
+
const CUSTOM_ELEMENT = seal(/^[a-z][a-z\d]*(-[a-z\d]+)+$/i);
|
157
157
|
var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
|
158
158
|
__proto__: null,
|
159
|
-
|
160
|
-
ATTR_WHITESPACE,
|
161
|
-
CUSTOM_ELEMENT,
|
162
|
-
DATA_ATTR,
|
163
|
-
DOCTYPE_NAME,
|
159
|
+
MUSTACHE_EXPR,
|
164
160
|
ERB_EXPR,
|
161
|
+
TMPLIT_EXPR,
|
162
|
+
DATA_ATTR,
|
163
|
+
ARIA_ATTR,
|
165
164
|
IS_ALLOWED_URI,
|
166
165
|
IS_SCRIPT_OR_DATA,
|
167
|
-
|
168
|
-
|
166
|
+
ATTR_WHITESPACE,
|
167
|
+
DOCTYPE_NAME,
|
168
|
+
CUSTOM_ELEMENT
|
169
169
|
});
|
170
|
-
const NODE_TYPE = {
|
171
|
-
element: 1,
|
172
|
-
attribute: 2,
|
173
|
-
text: 3,
|
174
|
-
cdataSection: 4,
|
175
|
-
entityReference: 5,
|
176
|
-
// Deprecated
|
177
|
-
entityNode: 6,
|
178
|
-
// Deprecated
|
179
|
-
progressingInstruction: 7,
|
180
|
-
comment: 8,
|
181
|
-
document: 9,
|
182
|
-
documentType: 10,
|
183
|
-
documentFragment: 11,
|
184
|
-
notation: 12
|
185
|
-
// Deprecated
|
186
|
-
};
|
187
170
|
const getGlobal = function getGlobal2() {
|
188
171
|
return typeof window === "undefined" ? null : window;
|
189
172
|
};
|
@@ -211,25 +194,12 @@ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTyp
|
|
211
194
|
return null;
|
212
195
|
}
|
213
196
|
};
|
214
|
-
const _createHooksMap = function _createHooksMap2() {
|
215
|
-
return {
|
216
|
-
afterSanitizeAttributes: [],
|
217
|
-
afterSanitizeElements: [],
|
218
|
-
afterSanitizeShadowDOM: [],
|
219
|
-
beforeSanitizeAttributes: [],
|
220
|
-
beforeSanitizeElements: [],
|
221
|
-
beforeSanitizeShadowDOM: [],
|
222
|
-
uponSanitizeAttribute: [],
|
223
|
-
uponSanitizeElement: [],
|
224
|
-
uponSanitizeShadowNode: []
|
225
|
-
};
|
226
|
-
};
|
227
197
|
function createDOMPurify() {
|
228
198
|
let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
|
229
199
|
const DOMPurify = (root) => createDOMPurify(root);
|
230
|
-
DOMPurify.version = "3.
|
200
|
+
DOMPurify.version = "3.0.10";
|
231
201
|
DOMPurify.removed = [];
|
232
|
-
if (!window2 || !window2.document || window2.document.nodeType !==
|
202
|
+
if (!window2 || !window2.document || window2.document.nodeType !== 9) {
|
233
203
|
DOMPurify.isSupported = false;
|
234
204
|
return DOMPurify;
|
235
205
|
}
|
@@ -251,7 +221,6 @@ function createDOMPurify() {
|
|
251
221
|
} = window2;
|
252
222
|
const ElementPrototype = Element.prototype;
|
253
223
|
const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
|
254
|
-
const remove = lookupGetter(ElementPrototype, "remove");
|
255
224
|
const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
|
256
225
|
const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
|
257
226
|
const getParentNode = lookupGetter(ElementPrototype, "parentNode");
|
@@ -272,7 +241,7 @@ function createDOMPurify() {
|
|
272
241
|
const {
|
273
242
|
importNode
|
274
243
|
} = originalDocument;
|
275
|
-
let hooks =
|
244
|
+
let hooks = {};
|
276
245
|
DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
|
277
246
|
const {
|
278
247
|
MUSTACHE_EXPR: MUSTACHE_EXPR2,
|
@@ -318,7 +287,6 @@ function createDOMPurify() {
|
|
318
287
|
let ALLOW_UNKNOWN_PROTOCOLS = false;
|
319
288
|
let ALLOW_SELF_CLOSE_IN_ATTR = true;
|
320
289
|
let SAFE_FOR_TEMPLATES = false;
|
321
|
-
let SAFE_FOR_XML = true;
|
322
290
|
let WHOLE_DOCUMENT = false;
|
323
291
|
let SET_CONFIG = false;
|
324
292
|
let FORCE_BODY = false;
|
@@ -344,9 +312,6 @@ function createDOMPurify() {
|
|
344
312
|
let IS_EMPTY_INPUT = false;
|
345
313
|
let ALLOWED_NAMESPACES = null;
|
346
314
|
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
347
|
-
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
|
348
|
-
let HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]);
|
349
|
-
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
|
350
315
|
let PARSER_MEDIA_TYPE = null;
|
351
316
|
const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
|
352
317
|
const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
|
@@ -371,8 +336,22 @@ function createDOMPurify() {
|
|
371
336
|
ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
|
372
337
|
ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
|
373
338
|
ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
|
374
|
-
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(
|
375
|
-
|
339
|
+
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(
|
340
|
+
clone(DEFAULT_URI_SAFE_ATTRIBUTES),
|
341
|
+
// eslint-disable-line indent
|
342
|
+
cfg.ADD_URI_SAFE_ATTR,
|
343
|
+
// eslint-disable-line indent
|
344
|
+
transformCaseFunc
|
345
|
+
// eslint-disable-line indent
|
346
|
+
) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
347
|
+
DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(
|
348
|
+
clone(DEFAULT_DATA_URI_TAGS),
|
349
|
+
// eslint-disable-line indent
|
350
|
+
cfg.ADD_DATA_URI_TAGS,
|
351
|
+
// eslint-disable-line indent
|
352
|
+
transformCaseFunc
|
353
|
+
// eslint-disable-line indent
|
354
|
+
) : DEFAULT_DATA_URI_TAGS;
|
376
355
|
FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
|
377
356
|
FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
|
378
357
|
FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
|
@@ -382,7 +361,6 @@ function createDOMPurify() {
|
|
382
361
|
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
|
383
362
|
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
|
384
363
|
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
|
385
|
-
SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
|
386
364
|
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
|
387
365
|
RETURN_DOM = cfg.RETURN_DOM || false;
|
388
366
|
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
|
@@ -394,8 +372,6 @@ function createDOMPurify() {
|
|
394
372
|
IN_PLACE = cfg.IN_PLACE || false;
|
395
373
|
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
396
374
|
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
397
|
-
MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
|
398
|
-
HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
|
399
375
|
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
400
376
|
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
401
377
|
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
@@ -488,6 +464,9 @@ function createDOMPurify() {
|
|
488
464
|
}
|
489
465
|
CONFIG = cfg;
|
490
466
|
};
|
467
|
+
const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
|
468
|
+
const HTML_INTEGRATION_POINTS = addToSet({}, ["foreignobject", "desc", "title", "annotation-xml"]);
|
469
|
+
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
|
491
470
|
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
492
471
|
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
493
472
|
const _checkValidNamespace = function _checkValidNamespace2(element) {
|
@@ -540,33 +519,33 @@ function createDOMPurify() {
|
|
540
519
|
element: node
|
541
520
|
});
|
542
521
|
try {
|
543
|
-
|
522
|
+
node.parentNode.removeChild(node);
|
544
523
|
} catch (_) {
|
545
|
-
remove(
|
524
|
+
node.remove();
|
546
525
|
}
|
547
526
|
};
|
548
|
-
const _removeAttribute = function _removeAttribute2(name,
|
527
|
+
const _removeAttribute = function _removeAttribute2(name, node) {
|
549
528
|
try {
|
550
529
|
arrayPush(DOMPurify.removed, {
|
551
|
-
attribute:
|
552
|
-
from:
|
530
|
+
attribute: node.getAttributeNode(name),
|
531
|
+
from: node
|
553
532
|
});
|
554
533
|
} catch (_) {
|
555
534
|
arrayPush(DOMPurify.removed, {
|
556
535
|
attribute: null,
|
557
|
-
from:
|
536
|
+
from: node
|
558
537
|
});
|
559
538
|
}
|
560
|
-
|
561
|
-
if (name === "is") {
|
539
|
+
node.removeAttribute(name);
|
540
|
+
if (name === "is" && !ALLOWED_ATTR[name]) {
|
562
541
|
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
563
542
|
try {
|
564
|
-
_forceRemove(
|
543
|
+
_forceRemove(node);
|
565
544
|
} catch (_) {
|
566
545
|
}
|
567
546
|
} else {
|
568
547
|
try {
|
569
|
-
|
548
|
+
node.setAttribute(name, "");
|
570
549
|
} catch (_) {
|
571
550
|
}
|
572
551
|
}
|
@@ -612,30 +591,33 @@ function createDOMPurify() {
|
|
612
591
|
root.ownerDocument || root,
|
613
592
|
root,
|
614
593
|
// eslint-disable-next-line no-bitwise
|
615
|
-
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION
|
594
|
+
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION,
|
616
595
|
null
|
617
596
|
);
|
618
597
|
};
|
619
|
-
const _isClobbered = function _isClobbered2(
|
620
|
-
return
|
598
|
+
const _isClobbered = function _isClobbered2(elm) {
|
599
|
+
return elm instanceof HTMLFormElement && (typeof elm.nodeName !== "string" || typeof elm.textContent !== "string" || typeof elm.removeChild !== "function" || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== "function" || typeof elm.setAttribute !== "function" || typeof elm.namespaceURI !== "string" || typeof elm.insertBefore !== "function" || typeof elm.hasChildNodes !== "function");
|
621
600
|
};
|
622
|
-
const _isNode = function _isNode2(
|
623
|
-
return typeof Node === "function" &&
|
601
|
+
const _isNode = function _isNode2(object) {
|
602
|
+
return typeof Node === "function" && object instanceof Node;
|
624
603
|
};
|
625
|
-
function
|
626
|
-
|
604
|
+
const _executeHook = function _executeHook2(entryPoint, currentNode, data) {
|
605
|
+
if (!hooks[entryPoint]) {
|
606
|
+
return;
|
607
|
+
}
|
608
|
+
arrayForEach(hooks[entryPoint], (hook) => {
|
627
609
|
hook.call(DOMPurify, currentNode, data, CONFIG);
|
628
610
|
});
|
629
|
-
}
|
611
|
+
};
|
630
612
|
const _sanitizeElements = function _sanitizeElements2(currentNode) {
|
631
613
|
let content = null;
|
632
|
-
|
614
|
+
_executeHook("beforeSanitizeElements", currentNode, null);
|
633
615
|
if (_isClobbered(currentNode)) {
|
634
616
|
_forceRemove(currentNode);
|
635
617
|
return true;
|
636
618
|
}
|
637
619
|
const tagName = transformCaseFunc(currentNode.nodeName);
|
638
|
-
|
620
|
+
_executeHook("uponSanitizeElement", currentNode, {
|
639
621
|
tagName,
|
640
622
|
allowedTags: ALLOWED_TAGS
|
641
623
|
});
|
@@ -643,14 +625,6 @@ function createDOMPurify() {
|
|
643
625
|
_forceRemove(currentNode);
|
644
626
|
return true;
|
645
627
|
}
|
646
|
-
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
|
647
|
-
_forceRemove(currentNode);
|
648
|
-
return true;
|
649
|
-
}
|
650
|
-
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
651
|
-
_forceRemove(currentNode);
|
652
|
-
return true;
|
653
|
-
}
|
654
628
|
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
655
629
|
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
656
630
|
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
@@ -666,9 +640,7 @@ function createDOMPurify() {
|
|
666
640
|
if (childNodes && parentNode) {
|
667
641
|
const childCount = childNodes.length;
|
668
642
|
for (let i = childCount - 1; i >= 0; --i) {
|
669
|
-
|
670
|
-
childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
|
671
|
-
parentNode.insertBefore(childClone, getNextSibling(currentNode));
|
643
|
+
parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
|
672
644
|
}
|
673
645
|
}
|
674
646
|
}
|
@@ -683,7 +655,7 @@ function createDOMPurify() {
|
|
683
655
|
_forceRemove(currentNode);
|
684
656
|
return true;
|
685
657
|
}
|
686
|
-
if (SAFE_FOR_TEMPLATES && currentNode.nodeType ===
|
658
|
+
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
|
687
659
|
content = currentNode.textContent;
|
688
660
|
arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
|
689
661
|
content = stringReplace(content, expr, " ");
|
@@ -695,7 +667,7 @@ function createDOMPurify() {
|
|
695
667
|
currentNode.textContent = content;
|
696
668
|
}
|
697
669
|
}
|
698
|
-
|
670
|
+
_executeHook("afterSanitizeElements", currentNode, null);
|
699
671
|
return false;
|
700
672
|
};
|
701
673
|
const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) {
|
@@ -737,19 +709,18 @@ function createDOMPurify() {
|
|
737
709
|
return tagName !== "annotation-xml" && stringMatch(tagName, CUSTOM_ELEMENT2);
|
738
710
|
};
|
739
711
|
const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
|
740
|
-
|
712
|
+
_executeHook("beforeSanitizeAttributes", currentNode, null);
|
741
713
|
const {
|
742
714
|
attributes
|
743
715
|
} = currentNode;
|
744
|
-
if (!attributes
|
716
|
+
if (!attributes) {
|
745
717
|
return;
|
746
718
|
}
|
747
719
|
const hookEvent = {
|
748
720
|
attrName: "",
|
749
721
|
attrValue: "",
|
750
722
|
keepAttr: true,
|
751
|
-
allowedAttributes: ALLOWED_ATTR
|
752
|
-
forceKeepAttr: void 0
|
723
|
+
allowedAttributes: ALLOWED_ATTR
|
753
724
|
};
|
754
725
|
let l = attributes.length;
|
755
726
|
while (l--) {
|
@@ -765,16 +736,8 @@ function createDOMPurify() {
|
|
765
736
|
hookEvent.attrValue = value;
|
766
737
|
hookEvent.keepAttr = true;
|
767
738
|
hookEvent.forceKeepAttr = void 0;
|
768
|
-
|
739
|
+
_executeHook("uponSanitizeAttribute", currentNode, hookEvent);
|
769
740
|
value = hookEvent.attrValue;
|
770
|
-
if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
|
771
|
-
_removeAttribute(name, currentNode);
|
772
|
-
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
773
|
-
}
|
774
|
-
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
775
|
-
_removeAttribute(name, currentNode);
|
776
|
-
continue;
|
777
|
-
}
|
778
741
|
if (hookEvent.forceKeepAttr) {
|
779
742
|
continue;
|
780
743
|
}
|
@@ -795,6 +758,10 @@ function createDOMPurify() {
|
|
795
758
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
796
759
|
continue;
|
797
760
|
}
|
761
|
+
if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
|
762
|
+
_removeAttribute(name, currentNode);
|
763
|
+
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
764
|
+
}
|
798
765
|
if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") {
|
799
766
|
if (namespaceURI)
|
800
767
|
;
|
@@ -817,29 +784,27 @@ function createDOMPurify() {
|
|
817
784
|
} else {
|
818
785
|
currentNode.setAttribute(name, value);
|
819
786
|
}
|
820
|
-
|
821
|
-
_forceRemove(currentNode);
|
822
|
-
} else {
|
823
|
-
arrayPop(DOMPurify.removed);
|
824
|
-
}
|
787
|
+
arrayPop(DOMPurify.removed);
|
825
788
|
} catch (_) {
|
826
789
|
}
|
827
790
|
}
|
828
|
-
|
791
|
+
_executeHook("afterSanitizeAttributes", currentNode, null);
|
829
792
|
};
|
830
793
|
const _sanitizeShadowDOM = function _sanitizeShadowDOM2(fragment) {
|
831
794
|
let shadowNode = null;
|
832
795
|
const shadowIterator = _createNodeIterator(fragment);
|
833
|
-
|
796
|
+
_executeHook("beforeSanitizeShadowDOM", fragment, null);
|
834
797
|
while (shadowNode = shadowIterator.nextNode()) {
|
835
|
-
|
836
|
-
_sanitizeElements(shadowNode)
|
837
|
-
|
798
|
+
_executeHook("uponSanitizeShadowNode", shadowNode, null);
|
799
|
+
if (_sanitizeElements(shadowNode)) {
|
800
|
+
continue;
|
801
|
+
}
|
838
802
|
if (shadowNode.content instanceof DocumentFragment) {
|
839
803
|
_sanitizeShadowDOM2(shadowNode.content);
|
840
804
|
}
|
805
|
+
_sanitizeAttributes(shadowNode);
|
841
806
|
}
|
842
|
-
|
807
|
+
_executeHook("afterSanitizeShadowDOM", fragment, null);
|
843
808
|
};
|
844
809
|
DOMPurify.sanitize = function(dirty) {
|
845
810
|
let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
@@ -881,7 +846,7 @@ function createDOMPurify() {
|
|
881
846
|
} else if (dirty instanceof Node) {
|
882
847
|
body = _initDocument("<!---->");
|
883
848
|
importedNode = body.ownerDocument.importNode(dirty, true);
|
884
|
-
if (importedNode.nodeType ===
|
849
|
+
if (importedNode.nodeType === 1 && importedNode.nodeName === "BODY") {
|
885
850
|
body = importedNode;
|
886
851
|
} else if (importedNode.nodeName === "HTML") {
|
887
852
|
body = importedNode;
|
@@ -903,11 +868,13 @@ function createDOMPurify() {
|
|
903
868
|
}
|
904
869
|
const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
|
905
870
|
while (currentNode = nodeIterator.nextNode()) {
|
906
|
-
_sanitizeElements(currentNode)
|
907
|
-
|
871
|
+
if (_sanitizeElements(currentNode)) {
|
872
|
+
continue;
|
873
|
+
}
|
908
874
|
if (currentNode.content instanceof DocumentFragment) {
|
909
875
|
_sanitizeShadowDOM(currentNode.content);
|
910
876
|
}
|
877
|
+
_sanitizeAttributes(currentNode);
|
911
878
|
}
|
912
879
|
if (IN_PLACE) {
|
913
880
|
return dirty;
|
@@ -958,16 +925,21 @@ function createDOMPurify() {
|
|
958
925
|
if (typeof hookFunction !== "function") {
|
959
926
|
return;
|
960
927
|
}
|
928
|
+
hooks[entryPoint] = hooks[entryPoint] || [];
|
961
929
|
arrayPush(hooks[entryPoint], hookFunction);
|
962
930
|
};
|
963
931
|
DOMPurify.removeHook = function(entryPoint) {
|
964
|
-
|
932
|
+
if (hooks[entryPoint]) {
|
933
|
+
return arrayPop(hooks[entryPoint]);
|
934
|
+
}
|
965
935
|
};
|
966
936
|
DOMPurify.removeHooks = function(entryPoint) {
|
967
|
-
hooks[entryPoint]
|
937
|
+
if (hooks[entryPoint]) {
|
938
|
+
hooks[entryPoint] = [];
|
939
|
+
}
|
968
940
|
};
|
969
941
|
DOMPurify.removeAllHooks = function() {
|
970
|
-
hooks =
|
942
|
+
hooks = {};
|
971
943
|
};
|
972
944
|
return DOMPurify;
|
973
945
|
}
|
@@ -31,18 +31,6 @@ function bash(hljs) {
|
|
31
31
|
end: /\)/,
|
32
32
|
contains: [hljs.BACKSLASH_ESCAPE]
|
33
33
|
};
|
34
|
-
const COMMENT = hljs.inherit(
|
35
|
-
hljs.COMMENT(),
|
36
|
-
{
|
37
|
-
match: [
|
38
|
-
/(^|\s)/,
|
39
|
-
/#.*$/
|
40
|
-
],
|
41
|
-
scope: {
|
42
|
-
2: "comment"
|
43
|
-
}
|
44
|
-
}
|
45
|
-
);
|
46
34
|
const HERE_DOC = {
|
47
35
|
begin: /<<-?\s*(?=\w+)/,
|
48
36
|
starts: { contains: [
|
@@ -115,7 +103,6 @@ function bash(hljs) {
|
|
115
103
|
"else",
|
116
104
|
"elif",
|
117
105
|
"fi",
|
118
|
-
"time",
|
119
106
|
"for",
|
120
107
|
"while",
|
121
108
|
"until",
|
@@ -124,7 +111,6 @@ function bash(hljs) {
|
|
124
111
|
"done",
|
125
112
|
"case",
|
126
113
|
"esac",
|
127
|
-
"coproc",
|
128
114
|
"function",
|
129
115
|
"select"
|
130
116
|
];
|
@@ -171,7 +157,6 @@ function bash(hljs) {
|
|
171
157
|
"read",
|
172
158
|
"readarray",
|
173
159
|
"source",
|
174
|
-
"sudo",
|
175
160
|
"type",
|
176
161
|
"typeset",
|
177
162
|
"ulimit",
|
@@ -354,10 +339,7 @@ function bash(hljs) {
|
|
354
339
|
];
|
355
340
|
return {
|
356
341
|
name: "Bash",
|
357
|
-
aliases: [
|
358
|
-
"sh",
|
359
|
-
"zsh"
|
360
|
-
],
|
342
|
+
aliases: ["sh"],
|
361
343
|
keywords: {
|
362
344
|
$pattern: /\b[a-z][a-z0-9._-]+\b/,
|
363
345
|
keyword: KEYWORDS,
|
@@ -379,7 +361,7 @@ function bash(hljs) {
|
|
379
361
|
// to catch unknown shells but still highlight the shebang
|
380
362
|
FUNCTION,
|
381
363
|
ARITHMETIC,
|
382
|
-
|
364
|
+
hljs.HASH_COMMENT_MODE,
|
383
365
|
HERE_DOC,
|
384
366
|
PATH_MODE,
|
385
367
|
QUOTE_STRING,
|
@@ -188,13 +188,7 @@ function basic(hljs) {
|
|
188
188
|
keyword: KEYWORDS
|
189
189
|
},
|
190
190
|
contains: [
|
191
|
-
|
192
|
-
// Match strings that start with " and end with " or a line break
|
193
|
-
scope: "string",
|
194
|
-
begin: /"/,
|
195
|
-
end: /"|$/,
|
196
|
-
contains: [hljs.BACKSLASH_ESCAPE]
|
197
|
-
},
|
191
|
+
hljs.QUOTE_STRING_MODE,
|
198
192
|
hljs.COMMENT("REM", "$", { relevance: 10 }),
|
199
193
|
hljs.COMMENT("'", "$", { relevance: 0 }),
|
200
194
|
{
|
@@ -36,10 +36,9 @@ function c(hljs) {
|
|
36
36
|
const NUMBERS = {
|
37
37
|
className: "number",
|
38
38
|
variants: [
|
39
|
-
{
|
40
|
-
{
|
41
|
-
{
|
42
|
-
{ match: /(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/ }
|
39
|
+
{ begin: "\\b(0b[01']+)" },
|
40
|
+
{ begin: "(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" },
|
41
|
+
{ begin: "(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" }
|
43
42
|
],
|
44
43
|
relevance: 0
|
45
44
|
};
|
@@ -47,7 +46,7 @@ function c(hljs) {
|
|
47
46
|
className: "meta",
|
48
47
|
begin: /#\s*[a-z]+\b/,
|
49
48
|
end: /$/,
|
50
|
-
keywords: { keyword: "if else elif endif define undef warning error line pragma _Pragma ifdef ifndef
|
49
|
+
keywords: { keyword: "if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" },
|
51
50
|
contains: [
|
52
51
|
{
|
53
52
|
begin: /\\\n/,
|
@@ -88,8 +87,6 @@ function c(hljs) {
|
|
88
87
|
"restrict",
|
89
88
|
"return",
|
90
89
|
"sizeof",
|
91
|
-
"typeof",
|
92
|
-
"typeof_unqual",
|
93
90
|
"struct",
|
94
91
|
"switch",
|
95
92
|
"typedef",
|
@@ -123,26 +120,14 @@ function c(hljs) {
|
|
123
120
|
"char",
|
124
121
|
"void",
|
125
122
|
"_Bool",
|
126
|
-
"_BitInt",
|
127
123
|
"_Complex",
|
128
124
|
"_Imaginary",
|
129
125
|
"_Decimal32",
|
130
126
|
"_Decimal64",
|
131
|
-
"_Decimal96",
|
132
127
|
"_Decimal128",
|
133
|
-
"_Decimal64x",
|
134
|
-
"_Decimal128x",
|
135
|
-
"_Float16",
|
136
|
-
"_Float32",
|
137
|
-
"_Float64",
|
138
|
-
"_Float128",
|
139
|
-
"_Float32x",
|
140
|
-
"_Float64x",
|
141
|
-
"_Float128x",
|
142
128
|
// modifiers
|
143
129
|
"const",
|
144
130
|
"static",
|
145
|
-
"constexpr",
|
146
131
|
// aliases
|
147
132
|
"complex",
|
148
133
|
"bool",
|