mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-28 09:47:48 +02:00
2202 lines
56 KiB
JavaScript
Vendored
2202 lines
56 KiB
JavaScript
Vendored
var __defProp = Object.defineProperty;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all2) => {
|
|
for (var name in all2)
|
|
__defProp(target, name, { get: all2[name], enumerable: true });
|
|
};
|
|
var __copyProps = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key2 of __getOwnPropNames(from))
|
|
if (!__hasOwnProp.call(to, key2) && key2 !== except)
|
|
__defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
|
|
// node_modules/rehype-stringify/index.js
|
|
var rehype_stringify_exports = {};
|
|
__export(rehype_stringify_exports, {
|
|
default: () => rehypeStringify
|
|
});
|
|
module.exports = __toCommonJS(rehype_stringify_exports);
|
|
|
|
// node_modules/html-void-elements/index.js
|
|
var htmlVoidElements = [
|
|
"area",
|
|
"base",
|
|
"basefont",
|
|
"bgsound",
|
|
"br",
|
|
"col",
|
|
"command",
|
|
"embed",
|
|
"frame",
|
|
"hr",
|
|
"image",
|
|
"img",
|
|
"input",
|
|
"keygen",
|
|
"link",
|
|
"meta",
|
|
"param",
|
|
"source",
|
|
"track",
|
|
"wbr"
|
|
];
|
|
|
|
// node_modules/property-information/lib/util/schema.js
|
|
var Schema = class {
|
|
/**
|
|
* @constructor
|
|
* @param {Properties} property
|
|
* @param {Normal} normal
|
|
* @param {string} [space]
|
|
*/
|
|
constructor(property, normal, space) {
|
|
this.property = property;
|
|
this.normal = normal;
|
|
if (space) {
|
|
this.space = space;
|
|
}
|
|
}
|
|
};
|
|
Schema.prototype.property = {};
|
|
Schema.prototype.normal = {};
|
|
Schema.prototype.space = null;
|
|
|
|
// node_modules/property-information/lib/util/merge.js
|
|
function merge(definitions, space) {
|
|
const property = {};
|
|
const normal = {};
|
|
let index = -1;
|
|
while (++index < definitions.length) {
|
|
Object.assign(property, definitions[index].property);
|
|
Object.assign(normal, definitions[index].normal);
|
|
}
|
|
return new Schema(property, normal, space);
|
|
}
|
|
|
|
// node_modules/property-information/lib/normalize.js
|
|
function normalize(value) {
|
|
return value.toLowerCase();
|
|
}
|
|
|
|
// node_modules/property-information/lib/util/info.js
|
|
var Info = class {
|
|
/**
|
|
* @constructor
|
|
* @param {string} property
|
|
* @param {string} attribute
|
|
*/
|
|
constructor(property, attribute) {
|
|
this.property = property;
|
|
this.attribute = attribute;
|
|
}
|
|
};
|
|
Info.prototype.space = null;
|
|
Info.prototype.boolean = false;
|
|
Info.prototype.booleanish = false;
|
|
Info.prototype.overloadedBoolean = false;
|
|
Info.prototype.number = false;
|
|
Info.prototype.commaSeparated = false;
|
|
Info.prototype.spaceSeparated = false;
|
|
Info.prototype.commaOrSpaceSeparated = false;
|
|
Info.prototype.mustUseProperty = false;
|
|
Info.prototype.defined = false;
|
|
|
|
// node_modules/property-information/lib/util/types.js
|
|
var types_exports = {};
|
|
__export(types_exports, {
|
|
boolean: () => boolean,
|
|
booleanish: () => booleanish,
|
|
commaOrSpaceSeparated: () => commaOrSpaceSeparated,
|
|
commaSeparated: () => commaSeparated,
|
|
number: () => number,
|
|
overloadedBoolean: () => overloadedBoolean,
|
|
spaceSeparated: () => spaceSeparated
|
|
});
|
|
var powers = 0;
|
|
var boolean = increment();
|
|
var booleanish = increment();
|
|
var overloadedBoolean = increment();
|
|
var number = increment();
|
|
var spaceSeparated = increment();
|
|
var commaSeparated = increment();
|
|
var commaOrSpaceSeparated = increment();
|
|
function increment() {
|
|
return 2 ** ++powers;
|
|
}
|
|
|
|
// node_modules/property-information/lib/util/defined-info.js
|
|
var checks = Object.keys(types_exports);
|
|
var DefinedInfo = class extends Info {
|
|
/**
|
|
* @constructor
|
|
* @param {string} property
|
|
* @param {string} attribute
|
|
* @param {number|null} [mask]
|
|
* @param {string} [space]
|
|
*/
|
|
constructor(property, attribute, mask, space) {
|
|
let index = -1;
|
|
super(property, attribute);
|
|
mark(this, "space", space);
|
|
if (typeof mask === "number") {
|
|
while (++index < checks.length) {
|
|
const check = checks[index];
|
|
mark(this, checks[index], (mask & types_exports[check]) === types_exports[check]);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
DefinedInfo.prototype.defined = true;
|
|
function mark(values, key2, value) {
|
|
if (value) {
|
|
values[key2] = value;
|
|
}
|
|
}
|
|
|
|
// node_modules/property-information/lib/util/create.js
|
|
var own = {}.hasOwnProperty;
|
|
function create(definition) {
|
|
const property = {};
|
|
const normal = {};
|
|
let prop;
|
|
for (prop in definition.properties) {
|
|
if (own.call(definition.properties, prop)) {
|
|
const value = definition.properties[prop];
|
|
const info = new DefinedInfo(
|
|
prop,
|
|
definition.transform(definition.attributes || {}, prop),
|
|
value,
|
|
definition.space
|
|
);
|
|
if (definition.mustUseProperty && definition.mustUseProperty.includes(prop)) {
|
|
info.mustUseProperty = true;
|
|
}
|
|
property[prop] = info;
|
|
normal[normalize(prop)] = prop;
|
|
normal[normalize(info.attribute)] = prop;
|
|
}
|
|
}
|
|
return new Schema(property, normal, definition.space);
|
|
}
|
|
|
|
// node_modules/property-information/lib/xlink.js
|
|
var xlink = create({
|
|
space: "xlink",
|
|
transform(_, prop) {
|
|
return "xlink:" + prop.slice(5).toLowerCase();
|
|
},
|
|
properties: {
|
|
xLinkActuate: null,
|
|
xLinkArcRole: null,
|
|
xLinkHref: null,
|
|
xLinkRole: null,
|
|
xLinkShow: null,
|
|
xLinkTitle: null,
|
|
xLinkType: null
|
|
}
|
|
});
|
|
|
|
// node_modules/property-information/lib/xml.js
|
|
var xml = create({
|
|
space: "xml",
|
|
transform(_, prop) {
|
|
return "xml:" + prop.slice(3).toLowerCase();
|
|
},
|
|
properties: { xmlLang: null, xmlBase: null, xmlSpace: null }
|
|
});
|
|
|
|
// node_modules/property-information/lib/util/case-sensitive-transform.js
|
|
function caseSensitiveTransform(attributes, attribute) {
|
|
return attribute in attributes ? attributes[attribute] : attribute;
|
|
}
|
|
|
|
// node_modules/property-information/lib/util/case-insensitive-transform.js
|
|
function caseInsensitiveTransform(attributes, property) {
|
|
return caseSensitiveTransform(attributes, property.toLowerCase());
|
|
}
|
|
|
|
// node_modules/property-information/lib/xmlns.js
|
|
var xmlns = create({
|
|
space: "xmlns",
|
|
attributes: { xmlnsxlink: "xmlns:xlink" },
|
|
transform: caseInsensitiveTransform,
|
|
properties: { xmlns: null, xmlnsXLink: null }
|
|
});
|
|
|
|
// node_modules/property-information/lib/aria.js
|
|
var aria = create({
|
|
transform(_, prop) {
|
|
return prop === "role" ? prop : "aria-" + prop.slice(4).toLowerCase();
|
|
},
|
|
properties: {
|
|
ariaActiveDescendant: null,
|
|
ariaAtomic: booleanish,
|
|
ariaAutoComplete: null,
|
|
ariaBusy: booleanish,
|
|
ariaChecked: booleanish,
|
|
ariaColCount: number,
|
|
ariaColIndex: number,
|
|
ariaColSpan: number,
|
|
ariaControls: spaceSeparated,
|
|
ariaCurrent: null,
|
|
ariaDescribedBy: spaceSeparated,
|
|
ariaDetails: null,
|
|
ariaDisabled: booleanish,
|
|
ariaDropEffect: spaceSeparated,
|
|
ariaErrorMessage: null,
|
|
ariaExpanded: booleanish,
|
|
ariaFlowTo: spaceSeparated,
|
|
ariaGrabbed: booleanish,
|
|
ariaHasPopup: null,
|
|
ariaHidden: booleanish,
|
|
ariaInvalid: null,
|
|
ariaKeyShortcuts: null,
|
|
ariaLabel: null,
|
|
ariaLabelledBy: spaceSeparated,
|
|
ariaLevel: number,
|
|
ariaLive: null,
|
|
ariaModal: booleanish,
|
|
ariaMultiLine: booleanish,
|
|
ariaMultiSelectable: booleanish,
|
|
ariaOrientation: null,
|
|
ariaOwns: spaceSeparated,
|
|
ariaPlaceholder: null,
|
|
ariaPosInSet: number,
|
|
ariaPressed: booleanish,
|
|
ariaReadOnly: booleanish,
|
|
ariaRelevant: null,
|
|
ariaRequired: booleanish,
|
|
ariaRoleDescription: spaceSeparated,
|
|
ariaRowCount: number,
|
|
ariaRowIndex: number,
|
|
ariaRowSpan: number,
|
|
ariaSelected: booleanish,
|
|
ariaSetSize: number,
|
|
ariaSort: null,
|
|
ariaValueMax: number,
|
|
ariaValueMin: number,
|
|
ariaValueNow: number,
|
|
ariaValueText: null,
|
|
role: null
|
|
}
|
|
});
|
|
|
|
// node_modules/property-information/lib/html.js
|
|
var html = create({
|
|
space: "html",
|
|
attributes: {
|
|
acceptcharset: "accept-charset",
|
|
classname: "class",
|
|
htmlfor: "for",
|
|
httpequiv: "http-equiv"
|
|
},
|
|
transform: caseInsensitiveTransform,
|
|
mustUseProperty: ["checked", "multiple", "muted", "selected"],
|
|
properties: {
|
|
// Standard Properties.
|
|
abbr: null,
|
|
accept: commaSeparated,
|
|
acceptCharset: spaceSeparated,
|
|
accessKey: spaceSeparated,
|
|
action: null,
|
|
allow: null,
|
|
allowFullScreen: boolean,
|
|
allowPaymentRequest: boolean,
|
|
allowUserMedia: boolean,
|
|
alt: null,
|
|
as: null,
|
|
async: boolean,
|
|
autoCapitalize: null,
|
|
autoComplete: spaceSeparated,
|
|
autoFocus: boolean,
|
|
autoPlay: boolean,
|
|
blocking: spaceSeparated,
|
|
capture: boolean,
|
|
charSet: null,
|
|
checked: boolean,
|
|
cite: null,
|
|
className: spaceSeparated,
|
|
cols: number,
|
|
colSpan: null,
|
|
content: null,
|
|
contentEditable: booleanish,
|
|
controls: boolean,
|
|
controlsList: spaceSeparated,
|
|
coords: number | commaSeparated,
|
|
crossOrigin: null,
|
|
data: null,
|
|
dateTime: null,
|
|
decoding: null,
|
|
default: boolean,
|
|
defer: boolean,
|
|
dir: null,
|
|
dirName: null,
|
|
disabled: boolean,
|
|
download: overloadedBoolean,
|
|
draggable: booleanish,
|
|
encType: null,
|
|
enterKeyHint: null,
|
|
fetchPriority: null,
|
|
form: null,
|
|
formAction: null,
|
|
formEncType: null,
|
|
formMethod: null,
|
|
formNoValidate: boolean,
|
|
formTarget: null,
|
|
headers: spaceSeparated,
|
|
height: number,
|
|
hidden: boolean,
|
|
high: number,
|
|
href: null,
|
|
hrefLang: null,
|
|
htmlFor: spaceSeparated,
|
|
httpEquiv: spaceSeparated,
|
|
id: null,
|
|
imageSizes: null,
|
|
imageSrcSet: null,
|
|
inert: boolean,
|
|
inputMode: null,
|
|
integrity: null,
|
|
is: null,
|
|
isMap: boolean,
|
|
itemId: null,
|
|
itemProp: spaceSeparated,
|
|
itemRef: spaceSeparated,
|
|
itemScope: boolean,
|
|
itemType: spaceSeparated,
|
|
kind: null,
|
|
label: null,
|
|
lang: null,
|
|
language: null,
|
|
list: null,
|
|
loading: null,
|
|
loop: boolean,
|
|
low: number,
|
|
manifest: null,
|
|
max: null,
|
|
maxLength: number,
|
|
media: null,
|
|
method: null,
|
|
min: null,
|
|
minLength: number,
|
|
multiple: boolean,
|
|
muted: boolean,
|
|
name: null,
|
|
nonce: null,
|
|
noModule: boolean,
|
|
noValidate: boolean,
|
|
onAbort: null,
|
|
onAfterPrint: null,
|
|
onAuxClick: null,
|
|
onBeforeMatch: null,
|
|
onBeforePrint: null,
|
|
onBeforeUnload: null,
|
|
onBlur: null,
|
|
onCancel: null,
|
|
onCanPlay: null,
|
|
onCanPlayThrough: null,
|
|
onChange: null,
|
|
onClick: null,
|
|
onClose: null,
|
|
onContextLost: null,
|
|
onContextMenu: null,
|
|
onContextRestored: null,
|
|
onCopy: null,
|
|
onCueChange: null,
|
|
onCut: null,
|
|
onDblClick: null,
|
|
onDrag: null,
|
|
onDragEnd: null,
|
|
onDragEnter: null,
|
|
onDragExit: null,
|
|
onDragLeave: null,
|
|
onDragOver: null,
|
|
onDragStart: null,
|
|
onDrop: null,
|
|
onDurationChange: null,
|
|
onEmptied: null,
|
|
onEnded: null,
|
|
onError: null,
|
|
onFocus: null,
|
|
onFormData: null,
|
|
onHashChange: null,
|
|
onInput: null,
|
|
onInvalid: null,
|
|
onKeyDown: null,
|
|
onKeyPress: null,
|
|
onKeyUp: null,
|
|
onLanguageChange: null,
|
|
onLoad: null,
|
|
onLoadedData: null,
|
|
onLoadedMetadata: null,
|
|
onLoadEnd: null,
|
|
onLoadStart: null,
|
|
onMessage: null,
|
|
onMessageError: null,
|
|
onMouseDown: null,
|
|
onMouseEnter: null,
|
|
onMouseLeave: null,
|
|
onMouseMove: null,
|
|
onMouseOut: null,
|
|
onMouseOver: null,
|
|
onMouseUp: null,
|
|
onOffline: null,
|
|
onOnline: null,
|
|
onPageHide: null,
|
|
onPageShow: null,
|
|
onPaste: null,
|
|
onPause: null,
|
|
onPlay: null,
|
|
onPlaying: null,
|
|
onPopState: null,
|
|
onProgress: null,
|
|
onRateChange: null,
|
|
onRejectionHandled: null,
|
|
onReset: null,
|
|
onResize: null,
|
|
onScroll: null,
|
|
onScrollEnd: null,
|
|
onSecurityPolicyViolation: null,
|
|
onSeeked: null,
|
|
onSeeking: null,
|
|
onSelect: null,
|
|
onSlotChange: null,
|
|
onStalled: null,
|
|
onStorage: null,
|
|
onSubmit: null,
|
|
onSuspend: null,
|
|
onTimeUpdate: null,
|
|
onToggle: null,
|
|
onUnhandledRejection: null,
|
|
onUnload: null,
|
|
onVolumeChange: null,
|
|
onWaiting: null,
|
|
onWheel: null,
|
|
open: boolean,
|
|
optimum: number,
|
|
pattern: null,
|
|
ping: spaceSeparated,
|
|
placeholder: null,
|
|
playsInline: boolean,
|
|
popover: null,
|
|
popoverTarget: null,
|
|
popoverTargetAction: null,
|
|
poster: null,
|
|
preload: null,
|
|
readOnly: boolean,
|
|
referrerPolicy: null,
|
|
rel: spaceSeparated,
|
|
required: boolean,
|
|
reversed: boolean,
|
|
rows: number,
|
|
rowSpan: number,
|
|
sandbox: spaceSeparated,
|
|
scope: null,
|
|
scoped: boolean,
|
|
seamless: boolean,
|
|
selected: boolean,
|
|
shape: null,
|
|
size: number,
|
|
sizes: null,
|
|
slot: null,
|
|
span: number,
|
|
spellCheck: booleanish,
|
|
src: null,
|
|
srcDoc: null,
|
|
srcLang: null,
|
|
srcSet: null,
|
|
start: number,
|
|
step: null,
|
|
style: null,
|
|
tabIndex: number,
|
|
target: null,
|
|
title: null,
|
|
translate: null,
|
|
type: null,
|
|
typeMustMatch: boolean,
|
|
useMap: null,
|
|
value: booleanish,
|
|
width: number,
|
|
wrap: null,
|
|
// Legacy.
|
|
// See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
|
|
align: null,
|
|
// Several. Use CSS `text-align` instead,
|
|
aLink: null,
|
|
// `<body>`. Use CSS `a:active {color}` instead
|
|
archive: spaceSeparated,
|
|
// `<object>`. List of URIs to archives
|
|
axis: null,
|
|
// `<td>` and `<th>`. Use `scope` on `<th>`
|
|
background: null,
|
|
// `<body>`. Use CSS `background-image` instead
|
|
bgColor: null,
|
|
// `<body>` and table elements. Use CSS `background-color` instead
|
|
border: number,
|
|
// `<table>`. Use CSS `border-width` instead,
|
|
borderColor: null,
|
|
// `<table>`. Use CSS `border-color` instead,
|
|
bottomMargin: number,
|
|
// `<body>`
|
|
cellPadding: null,
|
|
// `<table>`
|
|
cellSpacing: null,
|
|
// `<table>`
|
|
char: null,
|
|
// Several table elements. When `align=char`, sets the character to align on
|
|
charOff: null,
|
|
// Several table elements. When `char`, offsets the alignment
|
|
classId: null,
|
|
// `<object>`
|
|
clear: null,
|
|
// `<br>`. Use CSS `clear` instead
|
|
code: null,
|
|
// `<object>`
|
|
codeBase: null,
|
|
// `<object>`
|
|
codeType: null,
|
|
// `<object>`
|
|
color: null,
|
|
// `<font>` and `<hr>`. Use CSS instead
|
|
compact: boolean,
|
|
// Lists. Use CSS to reduce space between items instead
|
|
declare: boolean,
|
|
// `<object>`
|
|
event: null,
|
|
// `<script>`
|
|
face: null,
|
|
// `<font>`. Use CSS instead
|
|
frame: null,
|
|
// `<table>`
|
|
frameBorder: null,
|
|
// `<iframe>`. Use CSS `border` instead
|
|
hSpace: number,
|
|
// `<img>` and `<object>`
|
|
leftMargin: number,
|
|
// `<body>`
|
|
link: null,
|
|
// `<body>`. Use CSS `a:link {color: *}` instead
|
|
longDesc: null,
|
|
// `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`
|
|
lowSrc: null,
|
|
// `<img>`. Use a `<picture>`
|
|
marginHeight: number,
|
|
// `<body>`
|
|
marginWidth: number,
|
|
// `<body>`
|
|
noResize: boolean,
|
|
// `<frame>`
|
|
noHref: boolean,
|
|
// `<area>`. Use no href instead of an explicit `nohref`
|
|
noShade: boolean,
|
|
// `<hr>`. Use background-color and height instead of borders
|
|
noWrap: boolean,
|
|
// `<td>` and `<th>`
|
|
object: null,
|
|
// `<applet>`
|
|
profile: null,
|
|
// `<head>`
|
|
prompt: null,
|
|
// `<isindex>`
|
|
rev: null,
|
|
// `<link>`
|
|
rightMargin: number,
|
|
// `<body>`
|
|
rules: null,
|
|
// `<table>`
|
|
scheme: null,
|
|
// `<meta>`
|
|
scrolling: booleanish,
|
|
// `<frame>`. Use overflow in the child context
|
|
standby: null,
|
|
// `<object>`
|
|
summary: null,
|
|
// `<table>`
|
|
text: null,
|
|
// `<body>`. Use CSS `color` instead
|
|
topMargin: number,
|
|
// `<body>`
|
|
valueType: null,
|
|
// `<param>`
|
|
version: null,
|
|
// `<html>`. Use a doctype.
|
|
vAlign: null,
|
|
// Several. Use CSS `vertical-align` instead
|
|
vLink: null,
|
|
// `<body>`. Use CSS `a:visited {color}` instead
|
|
vSpace: number,
|
|
// `<img>` and `<object>`
|
|
// Non-standard Properties.
|
|
allowTransparency: null,
|
|
autoCorrect: null,
|
|
autoSave: null,
|
|
disablePictureInPicture: boolean,
|
|
disableRemotePlayback: boolean,
|
|
prefix: null,
|
|
property: null,
|
|
results: number,
|
|
security: null,
|
|
unselectable: null
|
|
}
|
|
});
|
|
|
|
// node_modules/property-information/lib/svg.js
|
|
var svg = create({
|
|
space: "svg",
|
|
attributes: {
|
|
accentHeight: "accent-height",
|
|
alignmentBaseline: "alignment-baseline",
|
|
arabicForm: "arabic-form",
|
|
baselineShift: "baseline-shift",
|
|
capHeight: "cap-height",
|
|
className: "class",
|
|
clipPath: "clip-path",
|
|
clipRule: "clip-rule",
|
|
colorInterpolation: "color-interpolation",
|
|
colorInterpolationFilters: "color-interpolation-filters",
|
|
colorProfile: "color-profile",
|
|
colorRendering: "color-rendering",
|
|
crossOrigin: "crossorigin",
|
|
dataType: "datatype",
|
|
dominantBaseline: "dominant-baseline",
|
|
enableBackground: "enable-background",
|
|
fillOpacity: "fill-opacity",
|
|
fillRule: "fill-rule",
|
|
floodColor: "flood-color",
|
|
floodOpacity: "flood-opacity",
|
|
fontFamily: "font-family",
|
|
fontSize: "font-size",
|
|
fontSizeAdjust: "font-size-adjust",
|
|
fontStretch: "font-stretch",
|
|
fontStyle: "font-style",
|
|
fontVariant: "font-variant",
|
|
fontWeight: "font-weight",
|
|
glyphName: "glyph-name",
|
|
glyphOrientationHorizontal: "glyph-orientation-horizontal",
|
|
glyphOrientationVertical: "glyph-orientation-vertical",
|
|
hrefLang: "hreflang",
|
|
horizAdvX: "horiz-adv-x",
|
|
horizOriginX: "horiz-origin-x",
|
|
horizOriginY: "horiz-origin-y",
|
|
imageRendering: "image-rendering",
|
|
letterSpacing: "letter-spacing",
|
|
lightingColor: "lighting-color",
|
|
markerEnd: "marker-end",
|
|
markerMid: "marker-mid",
|
|
markerStart: "marker-start",
|
|
navDown: "nav-down",
|
|
navDownLeft: "nav-down-left",
|
|
navDownRight: "nav-down-right",
|
|
navLeft: "nav-left",
|
|
navNext: "nav-next",
|
|
navPrev: "nav-prev",
|
|
navRight: "nav-right",
|
|
navUp: "nav-up",
|
|
navUpLeft: "nav-up-left",
|
|
navUpRight: "nav-up-right",
|
|
onAbort: "onabort",
|
|
onActivate: "onactivate",
|
|
onAfterPrint: "onafterprint",
|
|
onBeforePrint: "onbeforeprint",
|
|
onBegin: "onbegin",
|
|
onCancel: "oncancel",
|
|
onCanPlay: "oncanplay",
|
|
onCanPlayThrough: "oncanplaythrough",
|
|
onChange: "onchange",
|
|
onClick: "onclick",
|
|
onClose: "onclose",
|
|
onCopy: "oncopy",
|
|
onCueChange: "oncuechange",
|
|
onCut: "oncut",
|
|
onDblClick: "ondblclick",
|
|
onDrag: "ondrag",
|
|
onDragEnd: "ondragend",
|
|
onDragEnter: "ondragenter",
|
|
onDragExit: "ondragexit",
|
|
onDragLeave: "ondragleave",
|
|
onDragOver: "ondragover",
|
|
onDragStart: "ondragstart",
|
|
onDrop: "ondrop",
|
|
onDurationChange: "ondurationchange",
|
|
onEmptied: "onemptied",
|
|
onEnd: "onend",
|
|
onEnded: "onended",
|
|
onError: "onerror",
|
|
onFocus: "onfocus",
|
|
onFocusIn: "onfocusin",
|
|
onFocusOut: "onfocusout",
|
|
onHashChange: "onhashchange",
|
|
onInput: "oninput",
|
|
onInvalid: "oninvalid",
|
|
onKeyDown: "onkeydown",
|
|
onKeyPress: "onkeypress",
|
|
onKeyUp: "onkeyup",
|
|
onLoad: "onload",
|
|
onLoadedData: "onloadeddata",
|
|
onLoadedMetadata: "onloadedmetadata",
|
|
onLoadStart: "onloadstart",
|
|
onMessage: "onmessage",
|
|
onMouseDown: "onmousedown",
|
|
onMouseEnter: "onmouseenter",
|
|
onMouseLeave: "onmouseleave",
|
|
onMouseMove: "onmousemove",
|
|
onMouseOut: "onmouseout",
|
|
onMouseOver: "onmouseover",
|
|
onMouseUp: "onmouseup",
|
|
onMouseWheel: "onmousewheel",
|
|
onOffline: "onoffline",
|
|
onOnline: "ononline",
|
|
onPageHide: "onpagehide",
|
|
onPageShow: "onpageshow",
|
|
onPaste: "onpaste",
|
|
onPause: "onpause",
|
|
onPlay: "onplay",
|
|
onPlaying: "onplaying",
|
|
onPopState: "onpopstate",
|
|
onProgress: "onprogress",
|
|
onRateChange: "onratechange",
|
|
onRepeat: "onrepeat",
|
|
onReset: "onreset",
|
|
onResize: "onresize",
|
|
onScroll: "onscroll",
|
|
onSeeked: "onseeked",
|
|
onSeeking: "onseeking",
|
|
onSelect: "onselect",
|
|
onShow: "onshow",
|
|
onStalled: "onstalled",
|
|
onStorage: "onstorage",
|
|
onSubmit: "onsubmit",
|
|
onSuspend: "onsuspend",
|
|
onTimeUpdate: "ontimeupdate",
|
|
onToggle: "ontoggle",
|
|
onUnload: "onunload",
|
|
onVolumeChange: "onvolumechange",
|
|
onWaiting: "onwaiting",
|
|
onZoom: "onzoom",
|
|
overlinePosition: "overline-position",
|
|
overlineThickness: "overline-thickness",
|
|
paintOrder: "paint-order",
|
|
panose1: "panose-1",
|
|
pointerEvents: "pointer-events",
|
|
referrerPolicy: "referrerpolicy",
|
|
renderingIntent: "rendering-intent",
|
|
shapeRendering: "shape-rendering",
|
|
stopColor: "stop-color",
|
|
stopOpacity: "stop-opacity",
|
|
strikethroughPosition: "strikethrough-position",
|
|
strikethroughThickness: "strikethrough-thickness",
|
|
strokeDashArray: "stroke-dasharray",
|
|
strokeDashOffset: "stroke-dashoffset",
|
|
strokeLineCap: "stroke-linecap",
|
|
strokeLineJoin: "stroke-linejoin",
|
|
strokeMiterLimit: "stroke-miterlimit",
|
|
strokeOpacity: "stroke-opacity",
|
|
strokeWidth: "stroke-width",
|
|
tabIndex: "tabindex",
|
|
textAnchor: "text-anchor",
|
|
textDecoration: "text-decoration",
|
|
textRendering: "text-rendering",
|
|
transformOrigin: "transform-origin",
|
|
typeOf: "typeof",
|
|
underlinePosition: "underline-position",
|
|
underlineThickness: "underline-thickness",
|
|
unicodeBidi: "unicode-bidi",
|
|
unicodeRange: "unicode-range",
|
|
unitsPerEm: "units-per-em",
|
|
vAlphabetic: "v-alphabetic",
|
|
vHanging: "v-hanging",
|
|
vIdeographic: "v-ideographic",
|
|
vMathematical: "v-mathematical",
|
|
vectorEffect: "vector-effect",
|
|
vertAdvY: "vert-adv-y",
|
|
vertOriginX: "vert-origin-x",
|
|
vertOriginY: "vert-origin-y",
|
|
wordSpacing: "word-spacing",
|
|
writingMode: "writing-mode",
|
|
xHeight: "x-height",
|
|
// These were camelcased in Tiny. Now lowercased in SVG 2
|
|
playbackOrder: "playbackorder",
|
|
timelineBegin: "timelinebegin"
|
|
},
|
|
transform: caseSensitiveTransform,
|
|
properties: {
|
|
about: commaOrSpaceSeparated,
|
|
accentHeight: number,
|
|
accumulate: null,
|
|
additive: null,
|
|
alignmentBaseline: null,
|
|
alphabetic: number,
|
|
amplitude: number,
|
|
arabicForm: null,
|
|
ascent: number,
|
|
attributeName: null,
|
|
attributeType: null,
|
|
azimuth: number,
|
|
bandwidth: null,
|
|
baselineShift: null,
|
|
baseFrequency: null,
|
|
baseProfile: null,
|
|
bbox: null,
|
|
begin: null,
|
|
bias: number,
|
|
by: null,
|
|
calcMode: null,
|
|
capHeight: number,
|
|
className: spaceSeparated,
|
|
clip: null,
|
|
clipPath: null,
|
|
clipPathUnits: null,
|
|
clipRule: null,
|
|
color: null,
|
|
colorInterpolation: null,
|
|
colorInterpolationFilters: null,
|
|
colorProfile: null,
|
|
colorRendering: null,
|
|
content: null,
|
|
contentScriptType: null,
|
|
contentStyleType: null,
|
|
crossOrigin: null,
|
|
cursor: null,
|
|
cx: null,
|
|
cy: null,
|
|
d: null,
|
|
dataType: null,
|
|
defaultAction: null,
|
|
descent: number,
|
|
diffuseConstant: number,
|
|
direction: null,
|
|
display: null,
|
|
dur: null,
|
|
divisor: number,
|
|
dominantBaseline: null,
|
|
download: boolean,
|
|
dx: null,
|
|
dy: null,
|
|
edgeMode: null,
|
|
editable: null,
|
|
elevation: number,
|
|
enableBackground: null,
|
|
end: null,
|
|
event: null,
|
|
exponent: number,
|
|
externalResourcesRequired: null,
|
|
fill: null,
|
|
fillOpacity: number,
|
|
fillRule: null,
|
|
filter: null,
|
|
filterRes: null,
|
|
filterUnits: null,
|
|
floodColor: null,
|
|
floodOpacity: null,
|
|
focusable: null,
|
|
focusHighlight: null,
|
|
fontFamily: null,
|
|
fontSize: null,
|
|
fontSizeAdjust: null,
|
|
fontStretch: null,
|
|
fontStyle: null,
|
|
fontVariant: null,
|
|
fontWeight: null,
|
|
format: null,
|
|
fr: null,
|
|
from: null,
|
|
fx: null,
|
|
fy: null,
|
|
g1: commaSeparated,
|
|
g2: commaSeparated,
|
|
glyphName: commaSeparated,
|
|
glyphOrientationHorizontal: null,
|
|
glyphOrientationVertical: null,
|
|
glyphRef: null,
|
|
gradientTransform: null,
|
|
gradientUnits: null,
|
|
handler: null,
|
|
hanging: number,
|
|
hatchContentUnits: null,
|
|
hatchUnits: null,
|
|
height: null,
|
|
href: null,
|
|
hrefLang: null,
|
|
horizAdvX: number,
|
|
horizOriginX: number,
|
|
horizOriginY: number,
|
|
id: null,
|
|
ideographic: number,
|
|
imageRendering: null,
|
|
initialVisibility: null,
|
|
in: null,
|
|
in2: null,
|
|
intercept: number,
|
|
k: number,
|
|
k1: number,
|
|
k2: number,
|
|
k3: number,
|
|
k4: number,
|
|
kernelMatrix: commaOrSpaceSeparated,
|
|
kernelUnitLength: null,
|
|
keyPoints: null,
|
|
// SEMI_COLON_SEPARATED
|
|
keySplines: null,
|
|
// SEMI_COLON_SEPARATED
|
|
keyTimes: null,
|
|
// SEMI_COLON_SEPARATED
|
|
kerning: null,
|
|
lang: null,
|
|
lengthAdjust: null,
|
|
letterSpacing: null,
|
|
lightingColor: null,
|
|
limitingConeAngle: number,
|
|
local: null,
|
|
markerEnd: null,
|
|
markerMid: null,
|
|
markerStart: null,
|
|
markerHeight: null,
|
|
markerUnits: null,
|
|
markerWidth: null,
|
|
mask: null,
|
|
maskContentUnits: null,
|
|
maskUnits: null,
|
|
mathematical: null,
|
|
max: null,
|
|
media: null,
|
|
mediaCharacterEncoding: null,
|
|
mediaContentEncodings: null,
|
|
mediaSize: number,
|
|
mediaTime: null,
|
|
method: null,
|
|
min: null,
|
|
mode: null,
|
|
name: null,
|
|
navDown: null,
|
|
navDownLeft: null,
|
|
navDownRight: null,
|
|
navLeft: null,
|
|
navNext: null,
|
|
navPrev: null,
|
|
navRight: null,
|
|
navUp: null,
|
|
navUpLeft: null,
|
|
navUpRight: null,
|
|
numOctaves: null,
|
|
observer: null,
|
|
offset: null,
|
|
onAbort: null,
|
|
onActivate: null,
|
|
onAfterPrint: null,
|
|
onBeforePrint: null,
|
|
onBegin: null,
|
|
onCancel: null,
|
|
onCanPlay: null,
|
|
onCanPlayThrough: null,
|
|
onChange: null,
|
|
onClick: null,
|
|
onClose: null,
|
|
onCopy: null,
|
|
onCueChange: null,
|
|
onCut: null,
|
|
onDblClick: null,
|
|
onDrag: null,
|
|
onDragEnd: null,
|
|
onDragEnter: null,
|
|
onDragExit: null,
|
|
onDragLeave: null,
|
|
onDragOver: null,
|
|
onDragStart: null,
|
|
onDrop: null,
|
|
onDurationChange: null,
|
|
onEmptied: null,
|
|
onEnd: null,
|
|
onEnded: null,
|
|
onError: null,
|
|
onFocus: null,
|
|
onFocusIn: null,
|
|
onFocusOut: null,
|
|
onHashChange: null,
|
|
onInput: null,
|
|
onInvalid: null,
|
|
onKeyDown: null,
|
|
onKeyPress: null,
|
|
onKeyUp: null,
|
|
onLoad: null,
|
|
onLoadedData: null,
|
|
onLoadedMetadata: null,
|
|
onLoadStart: null,
|
|
onMessage: null,
|
|
onMouseDown: null,
|
|
onMouseEnter: null,
|
|
onMouseLeave: null,
|
|
onMouseMove: null,
|
|
onMouseOut: null,
|
|
onMouseOver: null,
|
|
onMouseUp: null,
|
|
onMouseWheel: null,
|
|
onOffline: null,
|
|
onOnline: null,
|
|
onPageHide: null,
|
|
onPageShow: null,
|
|
onPaste: null,
|
|
onPause: null,
|
|
onPlay: null,
|
|
onPlaying: null,
|
|
onPopState: null,
|
|
onProgress: null,
|
|
onRateChange: null,
|
|
onRepeat: null,
|
|
onReset: null,
|
|
onResize: null,
|
|
onScroll: null,
|
|
onSeeked: null,
|
|
onSeeking: null,
|
|
onSelect: null,
|
|
onShow: null,
|
|
onStalled: null,
|
|
onStorage: null,
|
|
onSubmit: null,
|
|
onSuspend: null,
|
|
onTimeUpdate: null,
|
|
onToggle: null,
|
|
onUnload: null,
|
|
onVolumeChange: null,
|
|
onWaiting: null,
|
|
onZoom: null,
|
|
opacity: null,
|
|
operator: null,
|
|
order: null,
|
|
orient: null,
|
|
orientation: null,
|
|
origin: null,
|
|
overflow: null,
|
|
overlay: null,
|
|
overlinePosition: number,
|
|
overlineThickness: number,
|
|
paintOrder: null,
|
|
panose1: null,
|
|
path: null,
|
|
pathLength: number,
|
|
patternContentUnits: null,
|
|
patternTransform: null,
|
|
patternUnits: null,
|
|
phase: null,
|
|
ping: spaceSeparated,
|
|
pitch: null,
|
|
playbackOrder: null,
|
|
pointerEvents: null,
|
|
points: null,
|
|
pointsAtX: number,
|
|
pointsAtY: number,
|
|
pointsAtZ: number,
|
|
preserveAlpha: null,
|
|
preserveAspectRatio: null,
|
|
primitiveUnits: null,
|
|
propagate: null,
|
|
property: commaOrSpaceSeparated,
|
|
r: null,
|
|
radius: null,
|
|
referrerPolicy: null,
|
|
refX: null,
|
|
refY: null,
|
|
rel: commaOrSpaceSeparated,
|
|
rev: commaOrSpaceSeparated,
|
|
renderingIntent: null,
|
|
repeatCount: null,
|
|
repeatDur: null,
|
|
requiredExtensions: commaOrSpaceSeparated,
|
|
requiredFeatures: commaOrSpaceSeparated,
|
|
requiredFonts: commaOrSpaceSeparated,
|
|
requiredFormats: commaOrSpaceSeparated,
|
|
resource: null,
|
|
restart: null,
|
|
result: null,
|
|
rotate: null,
|
|
rx: null,
|
|
ry: null,
|
|
scale: null,
|
|
seed: null,
|
|
shapeRendering: null,
|
|
side: null,
|
|
slope: null,
|
|
snapshotTime: null,
|
|
specularConstant: number,
|
|
specularExponent: number,
|
|
spreadMethod: null,
|
|
spacing: null,
|
|
startOffset: null,
|
|
stdDeviation: null,
|
|
stemh: null,
|
|
stemv: null,
|
|
stitchTiles: null,
|
|
stopColor: null,
|
|
stopOpacity: null,
|
|
strikethroughPosition: number,
|
|
strikethroughThickness: number,
|
|
string: null,
|
|
stroke: null,
|
|
strokeDashArray: commaOrSpaceSeparated,
|
|
strokeDashOffset: null,
|
|
strokeLineCap: null,
|
|
strokeLineJoin: null,
|
|
strokeMiterLimit: number,
|
|
strokeOpacity: number,
|
|
strokeWidth: null,
|
|
style: null,
|
|
surfaceScale: number,
|
|
syncBehavior: null,
|
|
syncBehaviorDefault: null,
|
|
syncMaster: null,
|
|
syncTolerance: null,
|
|
syncToleranceDefault: null,
|
|
systemLanguage: commaOrSpaceSeparated,
|
|
tabIndex: number,
|
|
tableValues: null,
|
|
target: null,
|
|
targetX: number,
|
|
targetY: number,
|
|
textAnchor: null,
|
|
textDecoration: null,
|
|
textRendering: null,
|
|
textLength: null,
|
|
timelineBegin: null,
|
|
title: null,
|
|
transformBehavior: null,
|
|
type: null,
|
|
typeOf: commaOrSpaceSeparated,
|
|
to: null,
|
|
transform: null,
|
|
transformOrigin: null,
|
|
u1: null,
|
|
u2: null,
|
|
underlinePosition: number,
|
|
underlineThickness: number,
|
|
unicode: null,
|
|
unicodeBidi: null,
|
|
unicodeRange: null,
|
|
unitsPerEm: number,
|
|
values: null,
|
|
vAlphabetic: number,
|
|
vMathematical: number,
|
|
vectorEffect: null,
|
|
vHanging: number,
|
|
vIdeographic: number,
|
|
version: null,
|
|
vertAdvY: number,
|
|
vertOriginX: number,
|
|
vertOriginY: number,
|
|
viewBox: null,
|
|
viewTarget: null,
|
|
visibility: null,
|
|
width: null,
|
|
widths: null,
|
|
wordSpacing: null,
|
|
writingMode: null,
|
|
x: null,
|
|
x1: null,
|
|
x2: null,
|
|
xChannelSelector: null,
|
|
xHeight: number,
|
|
y: null,
|
|
y1: null,
|
|
y2: null,
|
|
yChannelSelector: null,
|
|
z: null,
|
|
zoomAndPan: null
|
|
}
|
|
});
|
|
|
|
// node_modules/property-information/lib/find.js
|
|
var valid = /^data[-\w.:]+$/i;
|
|
var dash = /-[a-z]/g;
|
|
var cap = /[A-Z]/g;
|
|
function find(schema, value) {
|
|
const normal = normalize(value);
|
|
let prop = value;
|
|
let Type = Info;
|
|
if (normal in schema.normal) {
|
|
return schema.property[schema.normal[normal]];
|
|
}
|
|
if (normal.length > 4 && normal.slice(0, 4) === "data" && valid.test(value)) {
|
|
if (value.charAt(4) === "-") {
|
|
const rest = value.slice(5).replace(dash, camelcase);
|
|
prop = "data" + rest.charAt(0).toUpperCase() + rest.slice(1);
|
|
} else {
|
|
const rest = value.slice(4);
|
|
if (!dash.test(rest)) {
|
|
let dashes = rest.replace(cap, kebab);
|
|
if (dashes.charAt(0) !== "-") {
|
|
dashes = "-" + dashes;
|
|
}
|
|
value = "data" + dashes;
|
|
}
|
|
}
|
|
Type = DefinedInfo;
|
|
}
|
|
return new Type(prop, value);
|
|
}
|
|
function kebab($0) {
|
|
return "-" + $0.toLowerCase();
|
|
}
|
|
function camelcase($0) {
|
|
return $0.charAt(1).toUpperCase();
|
|
}
|
|
|
|
// node_modules/property-information/index.js
|
|
var html2 = merge([xml, xlink, xmlns, aria, html], "html");
|
|
var svg2 = merge([xml, xlink, xmlns, aria, svg], "svg");
|
|
|
|
// node_modules/zwitch/index.js
|
|
var own2 = {}.hasOwnProperty;
|
|
function zwitch(key2, options) {
|
|
const settings = options || {};
|
|
function one2(value, ...parameters) {
|
|
let fn = one2.invalid;
|
|
const handlers = one2.handlers;
|
|
if (value && own2.call(value, key2)) {
|
|
const id = String(value[key2]);
|
|
fn = own2.call(handlers, id) ? handlers[id] : one2.unknown;
|
|
}
|
|
if (fn) {
|
|
return fn.call(this, value, ...parameters);
|
|
}
|
|
}
|
|
one2.handlers = settings.handlers || {};
|
|
one2.invalid = settings.invalid;
|
|
one2.unknown = settings.unknown;
|
|
return one2;
|
|
}
|
|
|
|
// node_modules/stringify-entities/lib/core.js
|
|
function core(value, options) {
|
|
value = value.replace(
|
|
options.subset ? charactersToExpression(options.subset) : /["&'<>`]/g,
|
|
basic
|
|
);
|
|
if (options.subset || options.escapeOnly) {
|
|
return value;
|
|
}
|
|
return value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, surrogate).replace(
|
|
// eslint-disable-next-line no-control-regex, unicorn/no-hex-escape
|
|
/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,
|
|
basic
|
|
);
|
|
function surrogate(pair, index, all2) {
|
|
return options.format(
|
|
(pair.charCodeAt(0) - 55296) * 1024 + pair.charCodeAt(1) - 56320 + 65536,
|
|
all2.charCodeAt(index + 2),
|
|
options
|
|
);
|
|
}
|
|
function basic(character, index, all2) {
|
|
return options.format(
|
|
character.charCodeAt(0),
|
|
all2.charCodeAt(index + 1),
|
|
options
|
|
);
|
|
}
|
|
}
|
|
function charactersToExpression(subset) {
|
|
const groups = [];
|
|
let index = -1;
|
|
while (++index < subset.length) {
|
|
groups.push(subset[index].replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"));
|
|
}
|
|
return new RegExp("(?:" + groups.join("|") + ")", "g");
|
|
}
|
|
|
|
// node_modules/stringify-entities/lib/util/to-hexadecimal.js
|
|
function toHexadecimal(code, next, omit) {
|
|
const value = "&#x" + code.toString(16).toUpperCase();
|
|
return omit && next && !/[\dA-Fa-f]/.test(String.fromCharCode(next)) ? value : value + ";";
|
|
}
|
|
|
|
// node_modules/stringify-entities/lib/util/to-decimal.js
|
|
function toDecimal(code, next, omit) {
|
|
const value = "&#" + String(code);
|
|
return omit && next && !/\d/.test(String.fromCharCode(next)) ? value : value + ";";
|
|
}
|
|
|
|
// node_modules/character-entities-legacy/index.js
|
|
var characterEntitiesLegacy = [
|
|
"AElig",
|
|
"AMP",
|
|
"Aacute",
|
|
"Acirc",
|
|
"Agrave",
|
|
"Aring",
|
|
"Atilde",
|
|
"Auml",
|
|
"COPY",
|
|
"Ccedil",
|
|
"ETH",
|
|
"Eacute",
|
|
"Ecirc",
|
|
"Egrave",
|
|
"Euml",
|
|
"GT",
|
|
"Iacute",
|
|
"Icirc",
|
|
"Igrave",
|
|
"Iuml",
|
|
"LT",
|
|
"Ntilde",
|
|
"Oacute",
|
|
"Ocirc",
|
|
"Ograve",
|
|
"Oslash",
|
|
"Otilde",
|
|
"Ouml",
|
|
"QUOT",
|
|
"REG",
|
|
"THORN",
|
|
"Uacute",
|
|
"Ucirc",
|
|
"Ugrave",
|
|
"Uuml",
|
|
"Yacute",
|
|
"aacute",
|
|
"acirc",
|
|
"acute",
|
|
"aelig",
|
|
"agrave",
|
|
"amp",
|
|
"aring",
|
|
"atilde",
|
|
"auml",
|
|
"brvbar",
|
|
"ccedil",
|
|
"cedil",
|
|
"cent",
|
|
"copy",
|
|
"curren",
|
|
"deg",
|
|
"divide",
|
|
"eacute",
|
|
"ecirc",
|
|
"egrave",
|
|
"eth",
|
|
"euml",
|
|
"frac12",
|
|
"frac14",
|
|
"frac34",
|
|
"gt",
|
|
"iacute",
|
|
"icirc",
|
|
"iexcl",
|
|
"igrave",
|
|
"iquest",
|
|
"iuml",
|
|
"laquo",
|
|
"lt",
|
|
"macr",
|
|
"micro",
|
|
"middot",
|
|
"nbsp",
|
|
"not",
|
|
"ntilde",
|
|
"oacute",
|
|
"ocirc",
|
|
"ograve",
|
|
"ordf",
|
|
"ordm",
|
|
"oslash",
|
|
"otilde",
|
|
"ouml",
|
|
"para",
|
|
"plusmn",
|
|
"pound",
|
|
"quot",
|
|
"raquo",
|
|
"reg",
|
|
"sect",
|
|
"shy",
|
|
"sup1",
|
|
"sup2",
|
|
"sup3",
|
|
"szlig",
|
|
"thorn",
|
|
"times",
|
|
"uacute",
|
|
"ucirc",
|
|
"ugrave",
|
|
"uml",
|
|
"uuml",
|
|
"yacute",
|
|
"yen",
|
|
"yuml"
|
|
];
|
|
|
|
// node_modules/character-entities-html4/index.js
|
|
var characterEntitiesHtml4 = {
|
|
nbsp: "\xA0",
|
|
iexcl: "\xA1",
|
|
cent: "\xA2",
|
|
pound: "\xA3",
|
|
curren: "\xA4",
|
|
yen: "\xA5",
|
|
brvbar: "\xA6",
|
|
sect: "\xA7",
|
|
uml: "\xA8",
|
|
copy: "\xA9",
|
|
ordf: "\xAA",
|
|
laquo: "\xAB",
|
|
not: "\xAC",
|
|
shy: "\xAD",
|
|
reg: "\xAE",
|
|
macr: "\xAF",
|
|
deg: "\xB0",
|
|
plusmn: "\xB1",
|
|
sup2: "\xB2",
|
|
sup3: "\xB3",
|
|
acute: "\xB4",
|
|
micro: "\xB5",
|
|
para: "\xB6",
|
|
middot: "\xB7",
|
|
cedil: "\xB8",
|
|
sup1: "\xB9",
|
|
ordm: "\xBA",
|
|
raquo: "\xBB",
|
|
frac14: "\xBC",
|
|
frac12: "\xBD",
|
|
frac34: "\xBE",
|
|
iquest: "\xBF",
|
|
Agrave: "\xC0",
|
|
Aacute: "\xC1",
|
|
Acirc: "\xC2",
|
|
Atilde: "\xC3",
|
|
Auml: "\xC4",
|
|
Aring: "\xC5",
|
|
AElig: "\xC6",
|
|
Ccedil: "\xC7",
|
|
Egrave: "\xC8",
|
|
Eacute: "\xC9",
|
|
Ecirc: "\xCA",
|
|
Euml: "\xCB",
|
|
Igrave: "\xCC",
|
|
Iacute: "\xCD",
|
|
Icirc: "\xCE",
|
|
Iuml: "\xCF",
|
|
ETH: "\xD0",
|
|
Ntilde: "\xD1",
|
|
Ograve: "\xD2",
|
|
Oacute: "\xD3",
|
|
Ocirc: "\xD4",
|
|
Otilde: "\xD5",
|
|
Ouml: "\xD6",
|
|
times: "\xD7",
|
|
Oslash: "\xD8",
|
|
Ugrave: "\xD9",
|
|
Uacute: "\xDA",
|
|
Ucirc: "\xDB",
|
|
Uuml: "\xDC",
|
|
Yacute: "\xDD",
|
|
THORN: "\xDE",
|
|
szlig: "\xDF",
|
|
agrave: "\xE0",
|
|
aacute: "\xE1",
|
|
acirc: "\xE2",
|
|
atilde: "\xE3",
|
|
auml: "\xE4",
|
|
aring: "\xE5",
|
|
aelig: "\xE6",
|
|
ccedil: "\xE7",
|
|
egrave: "\xE8",
|
|
eacute: "\xE9",
|
|
ecirc: "\xEA",
|
|
euml: "\xEB",
|
|
igrave: "\xEC",
|
|
iacute: "\xED",
|
|
icirc: "\xEE",
|
|
iuml: "\xEF",
|
|
eth: "\xF0",
|
|
ntilde: "\xF1",
|
|
ograve: "\xF2",
|
|
oacute: "\xF3",
|
|
ocirc: "\xF4",
|
|
otilde: "\xF5",
|
|
ouml: "\xF6",
|
|
divide: "\xF7",
|
|
oslash: "\xF8",
|
|
ugrave: "\xF9",
|
|
uacute: "\xFA",
|
|
ucirc: "\xFB",
|
|
uuml: "\xFC",
|
|
yacute: "\xFD",
|
|
thorn: "\xFE",
|
|
yuml: "\xFF",
|
|
fnof: "\u0192",
|
|
Alpha: "\u0391",
|
|
Beta: "\u0392",
|
|
Gamma: "\u0393",
|
|
Delta: "\u0394",
|
|
Epsilon: "\u0395",
|
|
Zeta: "\u0396",
|
|
Eta: "\u0397",
|
|
Theta: "\u0398",
|
|
Iota: "\u0399",
|
|
Kappa: "\u039A",
|
|
Lambda: "\u039B",
|
|
Mu: "\u039C",
|
|
Nu: "\u039D",
|
|
Xi: "\u039E",
|
|
Omicron: "\u039F",
|
|
Pi: "\u03A0",
|
|
Rho: "\u03A1",
|
|
Sigma: "\u03A3",
|
|
Tau: "\u03A4",
|
|
Upsilon: "\u03A5",
|
|
Phi: "\u03A6",
|
|
Chi: "\u03A7",
|
|
Psi: "\u03A8",
|
|
Omega: "\u03A9",
|
|
alpha: "\u03B1",
|
|
beta: "\u03B2",
|
|
gamma: "\u03B3",
|
|
delta: "\u03B4",
|
|
epsilon: "\u03B5",
|
|
zeta: "\u03B6",
|
|
eta: "\u03B7",
|
|
theta: "\u03B8",
|
|
iota: "\u03B9",
|
|
kappa: "\u03BA",
|
|
lambda: "\u03BB",
|
|
mu: "\u03BC",
|
|
nu: "\u03BD",
|
|
xi: "\u03BE",
|
|
omicron: "\u03BF",
|
|
pi: "\u03C0",
|
|
rho: "\u03C1",
|
|
sigmaf: "\u03C2",
|
|
sigma: "\u03C3",
|
|
tau: "\u03C4",
|
|
upsilon: "\u03C5",
|
|
phi: "\u03C6",
|
|
chi: "\u03C7",
|
|
psi: "\u03C8",
|
|
omega: "\u03C9",
|
|
thetasym: "\u03D1",
|
|
upsih: "\u03D2",
|
|
piv: "\u03D6",
|
|
bull: "\u2022",
|
|
hellip: "\u2026",
|
|
prime: "\u2032",
|
|
Prime: "\u2033",
|
|
oline: "\u203E",
|
|
frasl: "\u2044",
|
|
weierp: "\u2118",
|
|
image: "\u2111",
|
|
real: "\u211C",
|
|
trade: "\u2122",
|
|
alefsym: "\u2135",
|
|
larr: "\u2190",
|
|
uarr: "\u2191",
|
|
rarr: "\u2192",
|
|
darr: "\u2193",
|
|
harr: "\u2194",
|
|
crarr: "\u21B5",
|
|
lArr: "\u21D0",
|
|
uArr: "\u21D1",
|
|
rArr: "\u21D2",
|
|
dArr: "\u21D3",
|
|
hArr: "\u21D4",
|
|
forall: "\u2200",
|
|
part: "\u2202",
|
|
exist: "\u2203",
|
|
empty: "\u2205",
|
|
nabla: "\u2207",
|
|
isin: "\u2208",
|
|
notin: "\u2209",
|
|
ni: "\u220B",
|
|
prod: "\u220F",
|
|
sum: "\u2211",
|
|
minus: "\u2212",
|
|
lowast: "\u2217",
|
|
radic: "\u221A",
|
|
prop: "\u221D",
|
|
infin: "\u221E",
|
|
ang: "\u2220",
|
|
and: "\u2227",
|
|
or: "\u2228",
|
|
cap: "\u2229",
|
|
cup: "\u222A",
|
|
int: "\u222B",
|
|
there4: "\u2234",
|
|
sim: "\u223C",
|
|
cong: "\u2245",
|
|
asymp: "\u2248",
|
|
ne: "\u2260",
|
|
equiv: "\u2261",
|
|
le: "\u2264",
|
|
ge: "\u2265",
|
|
sub: "\u2282",
|
|
sup: "\u2283",
|
|
nsub: "\u2284",
|
|
sube: "\u2286",
|
|
supe: "\u2287",
|
|
oplus: "\u2295",
|
|
otimes: "\u2297",
|
|
perp: "\u22A5",
|
|
sdot: "\u22C5",
|
|
lceil: "\u2308",
|
|
rceil: "\u2309",
|
|
lfloor: "\u230A",
|
|
rfloor: "\u230B",
|
|
lang: "\u2329",
|
|
rang: "\u232A",
|
|
loz: "\u25CA",
|
|
spades: "\u2660",
|
|
clubs: "\u2663",
|
|
hearts: "\u2665",
|
|
diams: "\u2666",
|
|
quot: '"',
|
|
amp: "&",
|
|
lt: "<",
|
|
gt: ">",
|
|
OElig: "\u0152",
|
|
oelig: "\u0153",
|
|
Scaron: "\u0160",
|
|
scaron: "\u0161",
|
|
Yuml: "\u0178",
|
|
circ: "\u02C6",
|
|
tilde: "\u02DC",
|
|
ensp: "\u2002",
|
|
emsp: "\u2003",
|
|
thinsp: "\u2009",
|
|
zwnj: "\u200C",
|
|
zwj: "\u200D",
|
|
lrm: "\u200E",
|
|
rlm: "\u200F",
|
|
ndash: "\u2013",
|
|
mdash: "\u2014",
|
|
lsquo: "\u2018",
|
|
rsquo: "\u2019",
|
|
sbquo: "\u201A",
|
|
ldquo: "\u201C",
|
|
rdquo: "\u201D",
|
|
bdquo: "\u201E",
|
|
dagger: "\u2020",
|
|
Dagger: "\u2021",
|
|
permil: "\u2030",
|
|
lsaquo: "\u2039",
|
|
rsaquo: "\u203A",
|
|
euro: "\u20AC"
|
|
};
|
|
|
|
// node_modules/stringify-entities/lib/constant/dangerous.js
|
|
var dangerous = [
|
|
"cent",
|
|
"copy",
|
|
"divide",
|
|
"gt",
|
|
"lt",
|
|
"not",
|
|
"para",
|
|
"times"
|
|
];
|
|
|
|
// node_modules/stringify-entities/lib/util/to-named.js
|
|
var own3 = {}.hasOwnProperty;
|
|
var characters = {};
|
|
var key;
|
|
for (key in characterEntitiesHtml4) {
|
|
if (own3.call(characterEntitiesHtml4, key)) {
|
|
characters[characterEntitiesHtml4[key]] = key;
|
|
}
|
|
}
|
|
function toNamed(code, next, omit, attribute) {
|
|
const character = String.fromCharCode(code);
|
|
if (own3.call(characters, character)) {
|
|
const name = characters[character];
|
|
const value = "&" + name;
|
|
if (omit && characterEntitiesLegacy.includes(name) && !dangerous.includes(name) && (!attribute || next && next !== 61 && /[^\da-z]/i.test(String.fromCharCode(next)))) {
|
|
return value;
|
|
}
|
|
return value + ";";
|
|
}
|
|
return "";
|
|
}
|
|
|
|
// node_modules/stringify-entities/lib/util/format-smart.js
|
|
function formatSmart(code, next, options) {
|
|
let numeric = toHexadecimal(code, next, options.omitOptionalSemicolons);
|
|
let named;
|
|
if (options.useNamedReferences || options.useShortestReferences) {
|
|
named = toNamed(
|
|
code,
|
|
next,
|
|
options.omitOptionalSemicolons,
|
|
options.attribute
|
|
);
|
|
}
|
|
if ((options.useShortestReferences || !named) && options.useShortestReferences) {
|
|
const decimal = toDecimal(code, next, options.omitOptionalSemicolons);
|
|
if (decimal.length < numeric.length) {
|
|
numeric = decimal;
|
|
}
|
|
}
|
|
return named && (!options.useShortestReferences || named.length < numeric.length) ? named : numeric;
|
|
}
|
|
|
|
// node_modules/stringify-entities/lib/index.js
|
|
function stringifyEntities(value, options) {
|
|
return core(value, Object.assign({ format: formatSmart }, options));
|
|
}
|
|
|
|
// node_modules/hast-util-to-html/lib/handle/comment.js
|
|
function comment(node, _1, _2, state) {
|
|
return state.settings.bogusComments ? "<?" + stringifyEntities(
|
|
node.value,
|
|
Object.assign({}, state.settings.characterReferences, { subset: [">"] })
|
|
) + ">" : "<!--" + node.value.replace(/^>|^->|<!--|-->|--!>|<!-$/g, encode) + "-->";
|
|
function encode($0) {
|
|
return stringifyEntities(
|
|
$0,
|
|
Object.assign({}, state.settings.characterReferences, {
|
|
subset: ["<", ">"]
|
|
})
|
|
);
|
|
}
|
|
}
|
|
|
|
// node_modules/hast-util-to-html/lib/handle/doctype.js
|
|
function doctype(_1, _2, _3, state) {
|
|
return "<!" + (state.settings.upperDoctype ? "DOCTYPE" : "doctype") + (state.settings.tightDoctype ? "" : " ") + "html>";
|
|
}
|
|
|
|
// node_modules/ccount/index.js
|
|
function ccount(value, character) {
|
|
const source = String(value);
|
|
if (typeof character !== "string") {
|
|
throw new TypeError("Expected character");
|
|
}
|
|
let count = 0;
|
|
let index = source.indexOf(character);
|
|
while (index !== -1) {
|
|
count++;
|
|
index = source.indexOf(character, index + character.length);
|
|
}
|
|
return count;
|
|
}
|
|
|
|
// node_modules/comma-separated-tokens/index.js
|
|
function stringify(values, options) {
|
|
const settings = options || {};
|
|
const input = values[values.length - 1] === "" ? [...values, ""] : values;
|
|
return input.join(
|
|
(settings.padRight ? " " : "") + "," + (settings.padLeft === false ? "" : " ")
|
|
).trim();
|
|
}
|
|
|
|
// node_modules/space-separated-tokens/index.js
|
|
function stringify2(values) {
|
|
return values.join(" ").trim();
|
|
}
|
|
|
|
// node_modules/hast-util-whitespace/lib/index.js
|
|
var re = /[ \t\n\f\r]/g;
|
|
function whitespace(thing) {
|
|
return typeof thing === "object" ? thing.type === "text" ? empty(thing.value) : false : empty(thing);
|
|
}
|
|
function empty(value) {
|
|
return value.replace(re, "") === "";
|
|
}
|
|
|
|
// node_modules/hast-util-to-html/lib/omission/util/siblings.js
|
|
var siblingAfter = siblings(1);
|
|
var siblingBefore = siblings(-1);
|
|
var emptyChildren = [];
|
|
function siblings(increment2) {
|
|
return sibling;
|
|
function sibling(parent, index, includeWhitespace) {
|
|
const siblings2 = parent ? parent.children : emptyChildren;
|
|
let offset = (index || 0) + increment2;
|
|
let next = siblings2[offset];
|
|
if (!includeWhitespace) {
|
|
while (next && whitespace(next)) {
|
|
offset += increment2;
|
|
next = siblings2[offset];
|
|
}
|
|
}
|
|
return next;
|
|
}
|
|
}
|
|
|
|
// node_modules/hast-util-to-html/lib/omission/omission.js
|
|
var own4 = {}.hasOwnProperty;
|
|
function omission(handlers) {
|
|
return omit;
|
|
function omit(node, index, parent) {
|
|
return own4.call(handlers, node.tagName) && handlers[node.tagName](node, index, parent);
|
|
}
|
|
}
|
|
|
|
// node_modules/hast-util-to-html/lib/omission/closing.js
|
|
var closing = omission({
|
|
body,
|
|
caption: headOrColgroupOrCaption,
|
|
colgroup: headOrColgroupOrCaption,
|
|
dd,
|
|
dt,
|
|
head: headOrColgroupOrCaption,
|
|
html: html3,
|
|
li,
|
|
optgroup,
|
|
option,
|
|
p,
|
|
rp: rubyElement,
|
|
rt: rubyElement,
|
|
tbody,
|
|
td: cells,
|
|
tfoot,
|
|
th: cells,
|
|
thead,
|
|
tr
|
|
});
|
|
function headOrColgroupOrCaption(_, index, parent) {
|
|
const next = siblingAfter(parent, index, true);
|
|
return !next || next.type !== "comment" && !(next.type === "text" && whitespace(next.value.charAt(0)));
|
|
}
|
|
function html3(_, index, parent) {
|
|
const next = siblingAfter(parent, index);
|
|
return !next || next.type !== "comment";
|
|
}
|
|
function body(_, index, parent) {
|
|
const next = siblingAfter(parent, index);
|
|
return !next || next.type !== "comment";
|
|
}
|
|
function p(_, index, parent) {
|
|
const next = siblingAfter(parent, index);
|
|
return next ? next.type === "element" && (next.tagName === "address" || next.tagName === "article" || next.tagName === "aside" || next.tagName === "blockquote" || next.tagName === "details" || next.tagName === "div" || next.tagName === "dl" || next.tagName === "fieldset" || next.tagName === "figcaption" || next.tagName === "figure" || next.tagName === "footer" || next.tagName === "form" || next.tagName === "h1" || next.tagName === "h2" || next.tagName === "h3" || next.tagName === "h4" || next.tagName === "h5" || next.tagName === "h6" || next.tagName === "header" || next.tagName === "hgroup" || next.tagName === "hr" || next.tagName === "main" || next.tagName === "menu" || next.tagName === "nav" || next.tagName === "ol" || next.tagName === "p" || next.tagName === "pre" || next.tagName === "section" || next.tagName === "table" || next.tagName === "ul") : !parent || // Confusing parent.
|
|
!(parent.type === "element" && (parent.tagName === "a" || parent.tagName === "audio" || parent.tagName === "del" || parent.tagName === "ins" || parent.tagName === "map" || parent.tagName === "noscript" || parent.tagName === "video"));
|
|
}
|
|
function li(_, index, parent) {
|
|
const next = siblingAfter(parent, index);
|
|
return !next || next.type === "element" && next.tagName === "li";
|
|
}
|
|
function dt(_, index, parent) {
|
|
const next = siblingAfter(parent, index);
|
|
return Boolean(
|
|
next && next.type === "element" && (next.tagName === "dt" || next.tagName === "dd")
|
|
);
|
|
}
|
|
function dd(_, index, parent) {
|
|
const next = siblingAfter(parent, index);
|
|
return !next || next.type === "element" && (next.tagName === "dt" || next.tagName === "dd");
|
|
}
|
|
function rubyElement(_, index, parent) {
|
|
const next = siblingAfter(parent, index);
|
|
return !next || next.type === "element" && (next.tagName === "rp" || next.tagName === "rt");
|
|
}
|
|
function optgroup(_, index, parent) {
|
|
const next = siblingAfter(parent, index);
|
|
return !next || next.type === "element" && next.tagName === "optgroup";
|
|
}
|
|
function option(_, index, parent) {
|
|
const next = siblingAfter(parent, index);
|
|
return !next || next.type === "element" && (next.tagName === "option" || next.tagName === "optgroup");
|
|
}
|
|
function thead(_, index, parent) {
|
|
const next = siblingAfter(parent, index);
|
|
return Boolean(
|
|
next && next.type === "element" && (next.tagName === "tbody" || next.tagName === "tfoot")
|
|
);
|
|
}
|
|
function tbody(_, index, parent) {
|
|
const next = siblingAfter(parent, index);
|
|
return !next || next.type === "element" && (next.tagName === "tbody" || next.tagName === "tfoot");
|
|
}
|
|
function tfoot(_, index, parent) {
|
|
return !siblingAfter(parent, index);
|
|
}
|
|
function tr(_, index, parent) {
|
|
const next = siblingAfter(parent, index);
|
|
return !next || next.type === "element" && next.tagName === "tr";
|
|
}
|
|
function cells(_, index, parent) {
|
|
const next = siblingAfter(parent, index);
|
|
return !next || next.type === "element" && (next.tagName === "td" || next.tagName === "th");
|
|
}
|
|
|
|
// node_modules/hast-util-to-html/lib/omission/opening.js
|
|
var opening = omission({
|
|
body: body2,
|
|
colgroup,
|
|
head,
|
|
html: html4,
|
|
tbody: tbody2
|
|
});
|
|
function html4(node) {
|
|
const head2 = siblingAfter(node, -1);
|
|
return !head2 || head2.type !== "comment";
|
|
}
|
|
function head(node) {
|
|
const children = node.children;
|
|
const seen = [];
|
|
let index = -1;
|
|
while (++index < children.length) {
|
|
const child = children[index];
|
|
if (child.type === "element" && (child.tagName === "title" || child.tagName === "base")) {
|
|
if (seen.includes(child.tagName))
|
|
return false;
|
|
seen.push(child.tagName);
|
|
}
|
|
}
|
|
return children.length > 0;
|
|
}
|
|
function body2(node) {
|
|
const head2 = siblingAfter(node, -1, true);
|
|
return !head2 || head2.type !== "comment" && !(head2.type === "text" && whitespace(head2.value.charAt(0))) && !(head2.type === "element" && (head2.tagName === "meta" || head2.tagName === "link" || head2.tagName === "script" || head2.tagName === "style" || head2.tagName === "template"));
|
|
}
|
|
function colgroup(node, index, parent) {
|
|
const previous = siblingBefore(parent, index);
|
|
const head2 = siblingAfter(node, -1, true);
|
|
if (parent && previous && previous.type === "element" && previous.tagName === "colgroup" && closing(previous, parent.children.indexOf(previous), parent)) {
|
|
return false;
|
|
}
|
|
return Boolean(head2 && head2.type === "element" && head2.tagName === "col");
|
|
}
|
|
function tbody2(node, index, parent) {
|
|
const previous = siblingBefore(parent, index);
|
|
const head2 = siblingAfter(node, -1);
|
|
if (parent && previous && previous.type === "element" && (previous.tagName === "thead" || previous.tagName === "tbody") && closing(previous, parent.children.indexOf(previous), parent)) {
|
|
return false;
|
|
}
|
|
return Boolean(head2 && head2.type === "element" && head2.tagName === "tr");
|
|
}
|
|
|
|
// node_modules/hast-util-to-html/lib/handle/element.js
|
|
var constants = {
|
|
// See: <https://html.spec.whatwg.org/#attribute-name-state>.
|
|
name: [
|
|
[" \n\f\r &/=>".split(""), " \n\f\r \"&'/=>`".split("")],
|
|
[`\0
|
|
\f\r "&'/<=>`.split(""), "\0 \n\f\r \"&'/<=>`".split("")]
|
|
],
|
|
// See: <https://html.spec.whatwg.org/#attribute-value-(unquoted)-state>.
|
|
unquoted: [
|
|
[" \n\f\r &>".split(""), "\0 \n\f\r \"&'<=>`".split("")],
|
|
["\0 \n\f\r \"&'<=>`".split(""), "\0 \n\f\r \"&'<=>`".split("")]
|
|
],
|
|
// See: <https://html.spec.whatwg.org/#attribute-value-(single-quoted)-state>.
|
|
single: [
|
|
["&'".split(""), "\"&'`".split("")],
|
|
["\0&'".split(""), "\0\"&'`".split("")]
|
|
],
|
|
// See: <https://html.spec.whatwg.org/#attribute-value-(double-quoted)-state>.
|
|
double: [
|
|
['"&'.split(""), "\"&'`".split("")],
|
|
['\0"&'.split(""), "\0\"&'`".split("")]
|
|
]
|
|
};
|
|
function element(node, index, parent, state) {
|
|
const schema = state.schema;
|
|
const omit = schema.space === "svg" ? false : state.settings.omitOptionalTags;
|
|
let selfClosing = schema.space === "svg" ? state.settings.closeEmptyElements : state.settings.voids.includes(node.tagName.toLowerCase());
|
|
const parts = [];
|
|
let last;
|
|
if (schema.space === "html" && node.tagName === "svg") {
|
|
state.schema = svg2;
|
|
}
|
|
const attrs = serializeAttributes(state, node.properties);
|
|
const content = state.all(
|
|
schema.space === "html" && node.tagName === "template" ? node.content : node
|
|
);
|
|
state.schema = schema;
|
|
if (content)
|
|
selfClosing = false;
|
|
if (attrs || !omit || !opening(node, index, parent)) {
|
|
parts.push("<", node.tagName, attrs ? " " + attrs : "");
|
|
if (selfClosing && (schema.space === "svg" || state.settings.closeSelfClosing)) {
|
|
last = attrs.charAt(attrs.length - 1);
|
|
if (!state.settings.tightSelfClosing || last === "/" || last && last !== '"' && last !== "'") {
|
|
parts.push(" ");
|
|
}
|
|
parts.push("/");
|
|
}
|
|
parts.push(">");
|
|
}
|
|
parts.push(content);
|
|
if (!selfClosing && (!omit || !closing(node, index, parent))) {
|
|
parts.push("</" + node.tagName + ">");
|
|
}
|
|
return parts.join("");
|
|
}
|
|
function serializeAttributes(state, props) {
|
|
const values = [];
|
|
let index = -1;
|
|
let key2;
|
|
if (props) {
|
|
for (key2 in props) {
|
|
if (props[key2] !== null && props[key2] !== void 0) {
|
|
const value = serializeAttribute(state, key2, props[key2]);
|
|
if (value)
|
|
values.push(value);
|
|
}
|
|
}
|
|
}
|
|
while (++index < values.length) {
|
|
const last = state.settings.tightAttributes ? values[index].charAt(values[index].length - 1) : void 0;
|
|
if (index !== values.length - 1 && last !== '"' && last !== "'") {
|
|
values[index] += " ";
|
|
}
|
|
}
|
|
return values.join("");
|
|
}
|
|
function serializeAttribute(state, key2, value) {
|
|
const info = find(state.schema, key2);
|
|
const x = state.settings.allowParseErrors && state.schema.space === "html" ? 0 : 1;
|
|
const y = state.settings.allowDangerousCharacters ? 0 : 1;
|
|
let quote = state.quote;
|
|
let result;
|
|
if (info.overloadedBoolean && (value === info.attribute || value === "")) {
|
|
value = true;
|
|
} else if (info.boolean || info.overloadedBoolean && typeof value !== "string") {
|
|
value = Boolean(value);
|
|
}
|
|
if (value === null || value === void 0 || value === false || typeof value === "number" && Number.isNaN(value)) {
|
|
return "";
|
|
}
|
|
const name = stringifyEntities(
|
|
info.attribute,
|
|
Object.assign({}, state.settings.characterReferences, {
|
|
// Always encode without parse errors in non-HTML.
|
|
subset: constants.name[x][y]
|
|
})
|
|
);
|
|
if (value === true)
|
|
return name;
|
|
value = Array.isArray(value) ? (info.commaSeparated ? stringify : stringify2)(value, {
|
|
padLeft: !state.settings.tightCommaSeparatedLists
|
|
}) : String(value);
|
|
if (state.settings.collapseEmptyAttributes && !value)
|
|
return name;
|
|
if (state.settings.preferUnquoted) {
|
|
result = stringifyEntities(
|
|
value,
|
|
Object.assign({}, state.settings.characterReferences, {
|
|
attribute: true,
|
|
subset: constants.unquoted[x][y]
|
|
})
|
|
);
|
|
}
|
|
if (result !== value) {
|
|
if (state.settings.quoteSmart && ccount(value, quote) > ccount(value, state.alternative)) {
|
|
quote = state.alternative;
|
|
}
|
|
result = quote + stringifyEntities(
|
|
value,
|
|
Object.assign({}, state.settings.characterReferences, {
|
|
// Always encode without parse errors in non-HTML.
|
|
subset: (quote === "'" ? constants.single : constants.double)[x][y],
|
|
attribute: true
|
|
})
|
|
) + quote;
|
|
}
|
|
return name + (result ? "=" + result : result);
|
|
}
|
|
|
|
// node_modules/hast-util-to-html/lib/handle/text.js
|
|
function text(node, _, parent, state) {
|
|
return parent && parent.type === "element" && (parent.tagName === "script" || parent.tagName === "style") ? node.value : stringifyEntities(
|
|
node.value,
|
|
Object.assign({}, state.settings.characterReferences, {
|
|
subset: ["<", "&"]
|
|
})
|
|
);
|
|
}
|
|
|
|
// node_modules/hast-util-to-html/lib/handle/raw.js
|
|
function raw(node, index, parent, state) {
|
|
return state.settings.allowDangerousHtml ? node.value : text(node, index, parent, state);
|
|
}
|
|
|
|
// node_modules/hast-util-to-html/lib/handle/root.js
|
|
function root(node, _1, _2, state) {
|
|
return state.all(node);
|
|
}
|
|
|
|
// node_modules/hast-util-to-html/lib/handle/index.js
|
|
var handle = zwitch("type", {
|
|
invalid,
|
|
unknown,
|
|
handlers: { comment, doctype, element, raw, root, text }
|
|
});
|
|
function invalid(node) {
|
|
throw new Error("Expected node, not `" + node + "`");
|
|
}
|
|
function unknown(node_) {
|
|
const node = (
|
|
/** @type {Nodes} */
|
|
node_
|
|
);
|
|
throw new Error("Cannot compile unknown node `" + node.type + "`");
|
|
}
|
|
|
|
// node_modules/hast-util-to-html/lib/index.js
|
|
var emptyOptions = {};
|
|
var emptyCharacterReferences = {};
|
|
var emptyChildren2 = [];
|
|
function toHtml(tree, options) {
|
|
const options_ = options || emptyOptions;
|
|
const quote = options_.quote || '"';
|
|
const alternative = quote === '"' ? "'" : '"';
|
|
if (quote !== '"' && quote !== "'") {
|
|
throw new Error("Invalid quote `" + quote + "`, expected `'` or `\"`");
|
|
}
|
|
const state = {
|
|
one,
|
|
all,
|
|
settings: {
|
|
omitOptionalTags: options_.omitOptionalTags || false,
|
|
allowParseErrors: options_.allowParseErrors || false,
|
|
allowDangerousCharacters: options_.allowDangerousCharacters || false,
|
|
quoteSmart: options_.quoteSmart || false,
|
|
preferUnquoted: options_.preferUnquoted || false,
|
|
tightAttributes: options_.tightAttributes || false,
|
|
upperDoctype: options_.upperDoctype || false,
|
|
tightDoctype: options_.tightDoctype || false,
|
|
bogusComments: options_.bogusComments || false,
|
|
tightCommaSeparatedLists: options_.tightCommaSeparatedLists || false,
|
|
tightSelfClosing: options_.tightSelfClosing || false,
|
|
collapseEmptyAttributes: options_.collapseEmptyAttributes || false,
|
|
allowDangerousHtml: options_.allowDangerousHtml || false,
|
|
voids: options_.voids || htmlVoidElements,
|
|
characterReferences: options_.characterReferences || emptyCharacterReferences,
|
|
closeSelfClosing: options_.closeSelfClosing || false,
|
|
closeEmptyElements: options_.closeEmptyElements || false
|
|
},
|
|
schema: options_.space === "svg" ? svg2 : html2,
|
|
quote,
|
|
alternative
|
|
};
|
|
return state.one(
|
|
Array.isArray(tree) ? { type: "root", children: tree } : tree,
|
|
void 0,
|
|
void 0
|
|
);
|
|
}
|
|
function one(node, index, parent) {
|
|
return handle(node, index, parent, this);
|
|
}
|
|
function all(parent) {
|
|
const results = [];
|
|
const children = parent && parent.children || emptyChildren2;
|
|
let index = -1;
|
|
while (++index < children.length) {
|
|
results[index] = this.one(children[index], index, parent);
|
|
}
|
|
return results.join("");
|
|
}
|
|
|
|
// node_modules/rehype-stringify/lib/index.js
|
|
function rehypeStringify(options) {
|
|
const self = this;
|
|
const settings = { ...self.data("settings"), ...options };
|
|
self.compiler = compiler;
|
|
function compiler(tree) {
|
|
return toHtml(tree, settings);
|
|
}
|
|
}
|