add initial marp implementation with sample content and build configuration
This commit is contained in:
9
node_modules/mathjax-full/js/adaptors/lite/Document.d.ts
generated
vendored
Normal file
9
node_modules/mathjax-full/js/adaptors/lite/Document.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { LiteElement } from './Element.js';
|
||||
export declare class LiteDocument {
|
||||
root: LiteElement;
|
||||
head: LiteElement;
|
||||
body: LiteElement;
|
||||
type: string;
|
||||
get kind(): string;
|
||||
constructor();
|
||||
}
|
||||
23
node_modules/mathjax-full/js/adaptors/lite/Document.js
generated
vendored
Normal file
23
node_modules/mathjax-full/js/adaptors/lite/Document.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LiteDocument = void 0;
|
||||
var Element_js_1 = require("./Element.js");
|
||||
var LiteDocument = (function () {
|
||||
function LiteDocument() {
|
||||
this.root = new Element_js_1.LiteElement('html', {}, [
|
||||
this.head = new Element_js_1.LiteElement('head'),
|
||||
this.body = new Element_js_1.LiteElement('body')
|
||||
]);
|
||||
this.type = '';
|
||||
}
|
||||
Object.defineProperty(LiteDocument.prototype, "kind", {
|
||||
get: function () {
|
||||
return '#document';
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return LiteDocument;
|
||||
}());
|
||||
exports.LiteDocument = LiteDocument;
|
||||
//# sourceMappingURL=Document.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/lite/Document.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/lite/Document.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Document.js","sourceRoot":"","sources":["../../../ts/adaptors/lite/Document.ts"],"names":[],"mappings":";;;AAuBA,2CAAyC;AAMzC;IA6BE;QACE,IAAI,CAAC,IAAI,GAAG,IAAI,wBAAW,CAAC,MAAM,EAAE,EAAE,EAAE;YACtC,IAAI,CAAC,IAAI,GAAG,IAAI,wBAAW,CAAC,MAAM,CAAC;YACnC,IAAI,CAAC,IAAI,GAAG,IAAI,wBAAW,CAAC,MAAM,CAAC;SACpC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IACjB,CAAC;IAbD,sBAAW,8BAAI;aAAf;YACE,OAAO,WAAW,CAAC;QACrB,CAAC;;;OAAA;IAYH,mBAAC;AAAD,CAAC,AApCD,IAoCC;AApCY,oCAAY"}
|
||||
13
node_modules/mathjax-full/js/adaptors/lite/Element.d.ts
generated
vendored
Normal file
13
node_modules/mathjax-full/js/adaptors/lite/Element.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { OptionList } from '../../util/Options.js';
|
||||
import { Styles } from '../../util/Styles.js';
|
||||
import { LiteText } from './Text.js';
|
||||
export declare type LiteAttributeList = OptionList;
|
||||
export declare type LiteNode = LiteElement | LiteText;
|
||||
export declare class LiteElement {
|
||||
kind: string;
|
||||
attributes: LiteAttributeList;
|
||||
children: LiteNode[];
|
||||
parent: LiteElement;
|
||||
styles: Styles;
|
||||
constructor(kind: string, attributes?: LiteAttributeList, children?: LiteNode[]);
|
||||
}
|
||||
77
node_modules/mathjax-full/js/adaptors/lite/Element.js
generated
vendored
Normal file
77
node_modules/mathjax-full/js/adaptors/lite/Element.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LiteElement = void 0;
|
||||
var LiteElement = (function () {
|
||||
function LiteElement(kind, attributes, children) {
|
||||
var e_1, _a;
|
||||
if (attributes === void 0) { attributes = {}; }
|
||||
if (children === void 0) { children = []; }
|
||||
this.kind = kind;
|
||||
this.attributes = __assign({}, attributes);
|
||||
this.children = __spreadArray([], __read(children), false);
|
||||
try {
|
||||
for (var _b = __values(this.children), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var child = _c.value;
|
||||
child.parent = this;
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
this.styles = null;
|
||||
}
|
||||
return LiteElement;
|
||||
}());
|
||||
exports.LiteElement = LiteElement;
|
||||
//# sourceMappingURL=Element.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/lite/Element.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/lite/Element.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Element.js","sourceRoot":"","sources":["../../../ts/adaptors/lite/Element.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;IAgCE,qBAAY,IAAY,EAAE,UAAkC,EAAE,QAAyB;;QAA7D,2BAAA,EAAA,eAAkC;QAAE,yBAAA,EAAA,aAAyB;QACrF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,gBAAO,UAAU,CAAC,CAAC;QAClC,IAAI,CAAC,QAAQ,4BAAO,QAAQ,SAAC,CAAC;;YAC9B,KAAoB,IAAA,KAAA,SAAA,IAAI,CAAC,QAAQ,CAAA,gBAAA,4BAAE;gBAA9B,IAAM,KAAK,WAAA;gBACd,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;aACrB;;;;;;;;;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IACH,kBAAC;AAAD,CAAC,AAzCD,IAyCC;AAzCY,kCAAW"}
|
||||
7
node_modules/mathjax-full/js/adaptors/lite/List.d.ts
generated
vendored
Normal file
7
node_modules/mathjax-full/js/adaptors/lite/List.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { LiteNode } from './Element.js';
|
||||
export declare class LiteList<N> {
|
||||
nodes: N[];
|
||||
constructor(children: N[]);
|
||||
append(node: N): void;
|
||||
[Symbol.iterator](): Iterator<LiteNode>;
|
||||
}
|
||||
50
node_modules/mathjax-full/js/adaptors/lite/List.js
generated
vendored
Normal file
50
node_modules/mathjax-full/js/adaptors/lite/List.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LiteList = void 0;
|
||||
var LiteList = (function () {
|
||||
function LiteList(children) {
|
||||
this.nodes = [];
|
||||
this.nodes = __spreadArray([], __read(children), false);
|
||||
}
|
||||
LiteList.prototype.append = function (node) {
|
||||
this.nodes.push(node);
|
||||
};
|
||||
LiteList.prototype[Symbol.iterator] = function () {
|
||||
var i = 0;
|
||||
return {
|
||||
next: function () {
|
||||
return (i === this.nodes.length ?
|
||||
{ value: null, done: true } :
|
||||
{ value: this.nodes[i++], done: false });
|
||||
}
|
||||
};
|
||||
};
|
||||
return LiteList;
|
||||
}());
|
||||
exports.LiteList = LiteList;
|
||||
//# sourceMappingURL=List.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/lite/List.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/lite/List.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../ts/adaptors/lite/List.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA;IAUE,kBAAY,QAAa;QANlB,UAAK,GAAQ,EAAE,CAAC;QAOrB,IAAI,CAAC,KAAK,4BAAO,QAAQ,SAAC,CAAC;IAC7B,CAAC;IAKM,yBAAM,GAAb,UAAc,IAAO;QACnB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAKM,mBAAC,MAAM,CAAC,QAAQ,CAAC,GAAxB;QACE,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,OAAO;YAIL,IAAI,EAAJ;gBACE,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;oBACzB,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;oBAC3B,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC;YACjD,CAAC;SACF,CAAC;IACJ,CAAC;IAEH,eAAC;AAAD,CAAC,AAtCD,IAsCC;AAtCY,4BAAQ"}
|
||||
43
node_modules/mathjax-full/js/adaptors/lite/Parser.d.ts
generated
vendored
Normal file
43
node_modules/mathjax-full/js/adaptors/lite/Parser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import { MinDOMParser } from '../HTMLAdaptor.js';
|
||||
import { LiteDocument } from './Document.js';
|
||||
import { LiteElement } from './Element.js';
|
||||
import { LiteText, LiteComment } from './Text.js';
|
||||
import { LiteAdaptor } from '../liteAdaptor.js';
|
||||
export declare namespace PATTERNS {
|
||||
const TAGNAME = "[a-z][^\\s\\n>]*";
|
||||
const ATTNAME = "[a-z][^\\s\\n>=]*";
|
||||
const VALUE = "(?:'[^']*'|\"[^\"]*\"|[^\\s\\n]+)";
|
||||
const VALUESPLIT = "(?:'([^']*)'|\"([^\"]*)\"|([^\\s\\n]+))";
|
||||
const SPACE = "(?:\\s|\\n)+";
|
||||
const OPTIONALSPACE = "(?:\\s|\\n)*";
|
||||
const ATTRIBUTE: string;
|
||||
const ATTRIBUTESPLIT: string;
|
||||
const TAG: string;
|
||||
const tag: RegExp;
|
||||
const attr: RegExp;
|
||||
const attrsplit: RegExp;
|
||||
}
|
||||
export declare class LiteParser implements MinDOMParser<LiteDocument> {
|
||||
static SELF_CLOSING: {
|
||||
[name: string]: boolean;
|
||||
};
|
||||
static PCDATA: {
|
||||
[name: string]: boolean;
|
||||
};
|
||||
static CDATA_ATTR: {
|
||||
[name: string]: boolean;
|
||||
};
|
||||
parseFromString(text: string, _format?: string, adaptor?: LiteAdaptor): LiteDocument;
|
||||
protected addText(adaptor: LiteAdaptor, node: LiteElement, text: string): LiteText;
|
||||
protected addComment(adaptor: LiteAdaptor, node: LiteElement, comment: string): LiteComment;
|
||||
protected closeTag(adaptor: LiteAdaptor, node: LiteElement, tag: string): LiteElement;
|
||||
protected openTag(adaptor: LiteAdaptor, node: LiteElement, tag: string, parts: string[]): LiteElement;
|
||||
protected addAttributes(adaptor: LiteAdaptor, node: LiteElement, attributes: string[]): void;
|
||||
protected handlePCDATA(adaptor: LiteAdaptor, node: LiteElement, kind: string, parts: string[]): void;
|
||||
protected checkDocument(adaptor: LiteAdaptor, root: LiteDocument): void;
|
||||
protected getOnlyChild(adaptor: LiteAdaptor, body: LiteElement): LiteElement;
|
||||
serialize(adaptor: LiteAdaptor, node: LiteElement, xml?: boolean): string;
|
||||
serializeInner(adaptor: LiteAdaptor, node: LiteElement, xml?: boolean): string;
|
||||
protectAttribute(text: string): string;
|
||||
protectHTML(text: string): string;
|
||||
}
|
||||
326
node_modules/mathjax-full/js/adaptors/lite/Parser.js
generated
vendored
Normal file
326
node_modules/mathjax-full/js/adaptors/lite/Parser.js
generated
vendored
Normal file
@@ -0,0 +1,326 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LiteParser = exports.PATTERNS = void 0;
|
||||
var Entities = __importStar(require("../../util/Entities.js"));
|
||||
var Element_js_1 = require("./Element.js");
|
||||
var Text_js_1 = require("./Text.js");
|
||||
var PATTERNS;
|
||||
(function (PATTERNS) {
|
||||
PATTERNS.TAGNAME = '[a-z][^\\s\\n>]*';
|
||||
PATTERNS.ATTNAME = '[a-z][^\\s\\n>=]*';
|
||||
PATTERNS.VALUE = "(?:'[^']*'|\"[^\"]*\"|[^\\s\\n]+)";
|
||||
PATTERNS.VALUESPLIT = "(?:'([^']*)'|\"([^\"]*)\"|([^\\s\\n]+))";
|
||||
PATTERNS.SPACE = '(?:\\s|\\n)+';
|
||||
PATTERNS.OPTIONALSPACE = '(?:\\s|\\n)*';
|
||||
PATTERNS.ATTRIBUTE = PATTERNS.ATTNAME + '(?:' + PATTERNS.OPTIONALSPACE + '=' + PATTERNS.OPTIONALSPACE + PATTERNS.VALUE + ')?';
|
||||
PATTERNS.ATTRIBUTESPLIT = '(' + PATTERNS.ATTNAME + ')(?:' + PATTERNS.OPTIONALSPACE + '=' + PATTERNS.OPTIONALSPACE + PATTERNS.VALUESPLIT + ')?';
|
||||
PATTERNS.TAG = '(<(?:' + PATTERNS.TAGNAME + '(?:' + PATTERNS.SPACE + PATTERNS.ATTRIBUTE + ')*'
|
||||
+ PATTERNS.OPTIONALSPACE + '/?|/' + PATTERNS.TAGNAME + '|!--[^]*?--|![^]*?)(?:>|$))';
|
||||
PATTERNS.tag = new RegExp(PATTERNS.TAG, 'i');
|
||||
PATTERNS.attr = new RegExp(PATTERNS.ATTRIBUTE, 'i');
|
||||
PATTERNS.attrsplit = new RegExp(PATTERNS.ATTRIBUTESPLIT, 'i');
|
||||
})(PATTERNS = exports.PATTERNS || (exports.PATTERNS = {}));
|
||||
var LiteParser = (function () {
|
||||
function LiteParser() {
|
||||
}
|
||||
LiteParser.prototype.parseFromString = function (text, _format, adaptor) {
|
||||
if (_format === void 0) { _format = 'text/html'; }
|
||||
if (adaptor === void 0) { adaptor = null; }
|
||||
var root = adaptor.createDocument();
|
||||
var node = adaptor.body(root);
|
||||
var parts = text.replace(/<\?.*?\?>/g, '').split(PATTERNS.tag);
|
||||
while (parts.length) {
|
||||
var text_1 = parts.shift();
|
||||
var tag = parts.shift();
|
||||
if (text_1) {
|
||||
this.addText(adaptor, node, text_1);
|
||||
}
|
||||
if (tag && tag.charAt(tag.length - 1) === '>') {
|
||||
if (tag.charAt(1) === '!') {
|
||||
this.addComment(adaptor, node, tag);
|
||||
}
|
||||
else if (tag.charAt(1) === '/') {
|
||||
node = this.closeTag(adaptor, node, tag);
|
||||
}
|
||||
else {
|
||||
node = this.openTag(adaptor, node, tag, parts);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.checkDocument(adaptor, root);
|
||||
return root;
|
||||
};
|
||||
LiteParser.prototype.addText = function (adaptor, node, text) {
|
||||
text = Entities.translate(text);
|
||||
return adaptor.append(node, adaptor.text(text));
|
||||
};
|
||||
LiteParser.prototype.addComment = function (adaptor, node, comment) {
|
||||
return adaptor.append(node, new Text_js_1.LiteComment(comment));
|
||||
};
|
||||
LiteParser.prototype.closeTag = function (adaptor, node, tag) {
|
||||
var kind = tag.slice(2, tag.length - 1).toLowerCase();
|
||||
while (adaptor.parent(node) && adaptor.kind(node) !== kind) {
|
||||
node = adaptor.parent(node);
|
||||
}
|
||||
return adaptor.parent(node);
|
||||
};
|
||||
LiteParser.prototype.openTag = function (adaptor, node, tag, parts) {
|
||||
var PCDATA = this.constructor.PCDATA;
|
||||
var SELF_CLOSING = this.constructor.SELF_CLOSING;
|
||||
var kind = tag.match(/<(.*?)[\s\n>\/]/)[1].toLowerCase();
|
||||
var child = adaptor.node(kind);
|
||||
var attributes = tag.replace(/^<.*?[\s\n>]/, '').split(PATTERNS.attrsplit);
|
||||
if (attributes.pop().match(/>$/) || attributes.length < 5) {
|
||||
this.addAttributes(adaptor, child, attributes);
|
||||
adaptor.append(node, child);
|
||||
if (!SELF_CLOSING[kind] && !tag.match(/\/>$/)) {
|
||||
if (PCDATA[kind]) {
|
||||
this.handlePCDATA(adaptor, child, kind, parts);
|
||||
}
|
||||
else {
|
||||
node = child;
|
||||
}
|
||||
}
|
||||
}
|
||||
return node;
|
||||
};
|
||||
LiteParser.prototype.addAttributes = function (adaptor, node, attributes) {
|
||||
var CDATA_ATTR = this.constructor.CDATA_ATTR;
|
||||
while (attributes.length) {
|
||||
var _a = __read(attributes.splice(0, 5), 5), name_1 = _a[1], v1 = _a[2], v2 = _a[3], v3 = _a[4];
|
||||
var value = v1 || v2 || v3 || '';
|
||||
if (!CDATA_ATTR[name_1]) {
|
||||
value = Entities.translate(value);
|
||||
}
|
||||
adaptor.setAttribute(node, name_1, value);
|
||||
}
|
||||
};
|
||||
LiteParser.prototype.handlePCDATA = function (adaptor, node, kind, parts) {
|
||||
var pcdata = [];
|
||||
var etag = '</' + kind + '>';
|
||||
var ptag = '';
|
||||
while (parts.length && ptag !== etag) {
|
||||
pcdata.push(ptag);
|
||||
pcdata.push(parts.shift());
|
||||
ptag = parts.shift();
|
||||
}
|
||||
adaptor.append(node, adaptor.text(pcdata.join('')));
|
||||
};
|
||||
LiteParser.prototype.checkDocument = function (adaptor, root) {
|
||||
var e_1, _a, e_2, _b;
|
||||
var node = this.getOnlyChild(adaptor, adaptor.body(root));
|
||||
if (!node)
|
||||
return;
|
||||
try {
|
||||
for (var _c = __values(adaptor.childNodes(adaptor.body(root))), _d = _c.next(); !_d.done; _d = _c.next()) {
|
||||
var child = _d.value;
|
||||
if (child === node) {
|
||||
break;
|
||||
}
|
||||
if (child instanceof Text_js_1.LiteComment && child.value.match(/^<!DOCTYPE/)) {
|
||||
root.type = child.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
switch (adaptor.kind(node)) {
|
||||
case 'html':
|
||||
try {
|
||||
for (var _e = __values(node.children), _f = _e.next(); !_f.done; _f = _e.next()) {
|
||||
var child = _f.value;
|
||||
switch (adaptor.kind(child)) {
|
||||
case 'head':
|
||||
root.head = child;
|
||||
break;
|
||||
case 'body':
|
||||
root.body = child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
root.root = node;
|
||||
adaptor.remove(node);
|
||||
if (adaptor.parent(root.body) !== node) {
|
||||
adaptor.append(node, root.body);
|
||||
}
|
||||
if (adaptor.parent(root.head) !== node) {
|
||||
adaptor.insert(root.head, root.body);
|
||||
}
|
||||
break;
|
||||
case 'head':
|
||||
root.head = adaptor.replace(node, root.head);
|
||||
break;
|
||||
case 'body':
|
||||
root.body = adaptor.replace(node, root.body);
|
||||
break;
|
||||
}
|
||||
};
|
||||
LiteParser.prototype.getOnlyChild = function (adaptor, body) {
|
||||
var e_3, _a;
|
||||
var node = null;
|
||||
try {
|
||||
for (var _b = __values(adaptor.childNodes(body)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var child = _c.value;
|
||||
if (child instanceof Element_js_1.LiteElement) {
|
||||
if (node)
|
||||
return null;
|
||||
node = child;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_3) throw e_3.error; }
|
||||
}
|
||||
return node;
|
||||
};
|
||||
LiteParser.prototype.serialize = function (adaptor, node, xml) {
|
||||
var _this = this;
|
||||
if (xml === void 0) { xml = false; }
|
||||
var SELF_CLOSING = this.constructor.SELF_CLOSING;
|
||||
var CDATA = this.constructor.CDATA_ATTR;
|
||||
var tag = adaptor.kind(node);
|
||||
var attributes = adaptor.allAttributes(node).map(function (x) { return x.name + '="' + (CDATA[x.name] ? x.value : _this.protectAttribute(x.value)) + '"'; }).join(' ');
|
||||
var content = this.serializeInner(adaptor, node, xml);
|
||||
var html = '<' + tag + (attributes ? ' ' + attributes : '')
|
||||
+ ((!xml || content) && !SELF_CLOSING[tag] ? ">".concat(content, "</").concat(tag, ">") : xml ? '/>' : '>');
|
||||
return html;
|
||||
};
|
||||
LiteParser.prototype.serializeInner = function (adaptor, node, xml) {
|
||||
var _this = this;
|
||||
if (xml === void 0) { xml = false; }
|
||||
var PCDATA = this.constructor.PCDATA;
|
||||
if (PCDATA.hasOwnProperty(node.kind)) {
|
||||
return adaptor.childNodes(node).map(function (x) { return adaptor.value(x); }).join('');
|
||||
}
|
||||
return adaptor.childNodes(node).map(function (x) {
|
||||
var kind = adaptor.kind(x);
|
||||
return (kind === '#text' ? _this.protectHTML(adaptor.value(x)) :
|
||||
kind === '#comment' ? x.value :
|
||||
_this.serialize(adaptor, x, xml));
|
||||
}).join('');
|
||||
};
|
||||
LiteParser.prototype.protectAttribute = function (text) {
|
||||
if (typeof text !== 'string') {
|
||||
text = String(text);
|
||||
}
|
||||
return text.replace(/"/g, '"');
|
||||
};
|
||||
LiteParser.prototype.protectHTML = function (text) {
|
||||
return text.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
};
|
||||
LiteParser.SELF_CLOSING = {
|
||||
area: true,
|
||||
base: true,
|
||||
br: true,
|
||||
col: true,
|
||||
command: true,
|
||||
embed: true,
|
||||
hr: true,
|
||||
img: true,
|
||||
input: true,
|
||||
keygen: true,
|
||||
link: true,
|
||||
menuitem: true,
|
||||
meta: true,
|
||||
param: true,
|
||||
source: true,
|
||||
track: true,
|
||||
wbr: true
|
||||
};
|
||||
LiteParser.PCDATA = {
|
||||
option: true,
|
||||
textarea: true,
|
||||
fieldset: true,
|
||||
title: true,
|
||||
style: true,
|
||||
script: true
|
||||
};
|
||||
LiteParser.CDATA_ATTR = {
|
||||
style: true,
|
||||
datafld: true,
|
||||
datasrc: true,
|
||||
href: true,
|
||||
src: true,
|
||||
longdesc: true,
|
||||
usemap: true,
|
||||
cite: true,
|
||||
datetime: true,
|
||||
action: true,
|
||||
axis: true,
|
||||
profile: true,
|
||||
content: true,
|
||||
scheme: true
|
||||
};
|
||||
return LiteParser;
|
||||
}());
|
||||
exports.LiteParser = LiteParser;
|
||||
//# sourceMappingURL=Parser.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/lite/Parser.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/lite/Parser.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
10
node_modules/mathjax-full/js/adaptors/lite/Text.d.ts
generated
vendored
Normal file
10
node_modules/mathjax-full/js/adaptors/lite/Text.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { LiteElement } from './Element.js';
|
||||
export declare class LiteText {
|
||||
value: string;
|
||||
parent: LiteElement;
|
||||
get kind(): string;
|
||||
constructor(text?: string);
|
||||
}
|
||||
export declare class LiteComment extends LiteText {
|
||||
get kind(): string;
|
||||
}
|
||||
49
node_modules/mathjax-full/js/adaptors/lite/Text.js
generated
vendored
Normal file
49
node_modules/mathjax-full/js/adaptors/lite/Text.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LiteComment = exports.LiteText = void 0;
|
||||
var LiteText = (function () {
|
||||
function LiteText(text) {
|
||||
if (text === void 0) { text = ''; }
|
||||
this.value = text;
|
||||
}
|
||||
Object.defineProperty(LiteText.prototype, "kind", {
|
||||
get: function () {
|
||||
return '#text';
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return LiteText;
|
||||
}());
|
||||
exports.LiteText = LiteText;
|
||||
var LiteComment = (function (_super) {
|
||||
__extends(LiteComment, _super);
|
||||
function LiteComment() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Object.defineProperty(LiteComment.prototype, "kind", {
|
||||
get: function () {
|
||||
return '#comment';
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return LiteComment;
|
||||
}(LiteText));
|
||||
exports.LiteComment = LiteComment;
|
||||
//# sourceMappingURL=Text.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/lite/Text.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/lite/Text.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../../ts/adaptors/lite/Text.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA6BA;IAsBE,kBAAY,IAAiB;QAAjB,qBAAA,EAAA,SAAiB;QAC3B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAVD,sBAAW,0BAAI;aAAf;YACE,OAAO,OAAO,CAAC;QACjB,CAAC;;;OAAA;IASH,eAAC;AAAD,CAAC,AAzBD,IAyBC;AAzBY,4BAAQ;AA+BrB;IAAiC,+BAAQ;IAAzC;;IAIA,CAAC;IAHC,sBAAW,6BAAI;aAAf;YACE,OAAO,UAAU,CAAC;QACpB,CAAC;;;OAAA;IACH,kBAAC;AAAD,CAAC,AAJD,CAAiC,QAAQ,GAIxC;AAJY,kCAAW"}
|
||||
14
node_modules/mathjax-full/js/adaptors/lite/Window.d.ts
generated
vendored
Normal file
14
node_modules/mathjax-full/js/adaptors/lite/Window.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { LiteElement } from './Element.js';
|
||||
import { LiteDocument } from './Document.js';
|
||||
import { LiteList } from './List.js';
|
||||
import { LiteParser } from './Parser.js';
|
||||
export declare class LiteWindow {
|
||||
document: LiteDocument;
|
||||
DOMParser: typeof LiteParser;
|
||||
NodeList: typeof LiteList;
|
||||
HTMLCollection: typeof LiteList;
|
||||
HTMLElement: typeof LiteElement;
|
||||
DocumentFragment: typeof LiteList;
|
||||
Document: typeof LiteDocument;
|
||||
constructor();
|
||||
}
|
||||
21
node_modules/mathjax-full/js/adaptors/lite/Window.js
generated
vendored
Normal file
21
node_modules/mathjax-full/js/adaptors/lite/Window.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LiteWindow = void 0;
|
||||
var Element_js_1 = require("./Element.js");
|
||||
var Document_js_1 = require("./Document.js");
|
||||
var List_js_1 = require("./List.js");
|
||||
var Parser_js_1 = require("./Parser.js");
|
||||
var LiteWindow = (function () {
|
||||
function LiteWindow() {
|
||||
this.DOMParser = Parser_js_1.LiteParser;
|
||||
this.NodeList = List_js_1.LiteList;
|
||||
this.HTMLCollection = List_js_1.LiteList;
|
||||
this.HTMLElement = Element_js_1.LiteElement;
|
||||
this.DocumentFragment = List_js_1.LiteList;
|
||||
this.Document = Document_js_1.LiteDocument;
|
||||
this.document = new Document_js_1.LiteDocument();
|
||||
}
|
||||
return LiteWindow;
|
||||
}());
|
||||
exports.LiteWindow = LiteWindow;
|
||||
//# sourceMappingURL=Window.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/lite/Window.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/lite/Window.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Window.js","sourceRoot":"","sources":["../../../ts/adaptors/lite/Window.ts"],"names":[],"mappings":";;;AAuBA,2CAAyC;AACzC,6CAA2C;AAC3C,qCAAmC;AACnC,yCAAuC;AAMvC;IAiCE;QAzBO,cAAS,GAAsB,sBAAU,CAAC;QAI1C,aAAQ,GAAoB,kBAAQ,CAAC;QAIrC,mBAAc,GAAoB,kBAAQ,CAAC;QAI3C,gBAAW,GAAuB,wBAAW,CAAC;QAI9C,qBAAgB,GAAqB,kBAAQ,CAAC;QAI9C,aAAQ,GAAyB,0BAAY,CAAC;QAMnD,IAAI,CAAC,QAAQ,GAAG,IAAI,0BAAY,EAAE,CAAC;IACrC,CAAC;IACH,iBAAC;AAAD,CAAC,AApCD,IAoCC;AApCY,gCAAU"}
|
||||
Reference in New Issue
Block a user