add initial marp implementation with sample content and build configuration
This commit is contained in:
13
node_modules/mathjax-full/js/input/mathml/FindMathML.d.ts
generated
vendored
Normal file
13
node_modules/mathjax-full/js/input/mathml/FindMathML.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { AbstractFindMath } from '../../core/FindMath.js';
|
||||
import { DOMAdaptor } from '../../core/DOMAdaptor.js';
|
||||
import { OptionList } from '../../util/Options.js';
|
||||
import { ProtoItem } from '../../core/MathItem.js';
|
||||
export declare class FindMathML<N, T, D> extends AbstractFindMath<N, T, D> {
|
||||
static OPTIONS: OptionList;
|
||||
adaptor: DOMAdaptor<N, T, D>;
|
||||
findMath(node: N): ProtoItem<N, T>[];
|
||||
protected findMathNodes(node: N, set: Set<N>): void;
|
||||
protected findMathPrefixed(node: N, set: Set<N>): void;
|
||||
protected findMathNS(node: N, set: Set<N>): void;
|
||||
protected processMath(set: Set<N>): ProtoItem<N, T>[];
|
||||
}
|
||||
137
node_modules/mathjax-full/js/input/mathml/FindMathML.js
generated
vendored
Normal file
137
node_modules/mathjax-full/js/input/mathml/FindMathML.js
generated
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
"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 __());
|
||||
};
|
||||
})();
|
||||
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.FindMathML = void 0;
|
||||
var FindMath_js_1 = require("../../core/FindMath.js");
|
||||
var NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
||||
var FindMathML = (function (_super) {
|
||||
__extends(FindMathML, _super);
|
||||
function FindMathML() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
FindMathML.prototype.findMath = function (node) {
|
||||
var set = new Set();
|
||||
this.findMathNodes(node, set);
|
||||
this.findMathPrefixed(node, set);
|
||||
var html = this.adaptor.root(this.adaptor.document);
|
||||
if (this.adaptor.kind(html) === 'html' && set.size === 0) {
|
||||
this.findMathNS(node, set);
|
||||
}
|
||||
return this.processMath(set);
|
||||
};
|
||||
FindMathML.prototype.findMathNodes = function (node, set) {
|
||||
var e_1, _a;
|
||||
try {
|
||||
for (var _b = __values(this.adaptor.tags(node, 'math')), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var math = _c.value;
|
||||
set.add(math);
|
||||
}
|
||||
}
|
||||
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; }
|
||||
}
|
||||
};
|
||||
FindMathML.prototype.findMathPrefixed = function (node, set) {
|
||||
var e_2, _a, e_3, _b;
|
||||
var html = this.adaptor.root(this.adaptor.document);
|
||||
try {
|
||||
for (var _c = __values(this.adaptor.allAttributes(html)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
||||
var attr = _d.value;
|
||||
if (attr.name.substr(0, 6) === 'xmlns:' && attr.value === NAMESPACE) {
|
||||
var prefix = attr.name.substr(6);
|
||||
try {
|
||||
for (var _e = (e_3 = void 0, __values(this.adaptor.tags(node, prefix + ':math'))), _f = _e.next(); !_f.done; _f = _e.next()) {
|
||||
var math = _f.value;
|
||||
set.add(math);
|
||||
}
|
||||
}
|
||||
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
||||
}
|
||||
finally { if (e_3) throw e_3.error; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
};
|
||||
FindMathML.prototype.findMathNS = function (node, set) {
|
||||
var e_4, _a;
|
||||
try {
|
||||
for (var _b = __values(this.adaptor.tags(node, 'math', NAMESPACE)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var math = _c.value;
|
||||
set.add(math);
|
||||
}
|
||||
}
|
||||
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_4) throw e_4.error; }
|
||||
}
|
||||
};
|
||||
FindMathML.prototype.processMath = function (set) {
|
||||
var e_5, _a;
|
||||
var math = [];
|
||||
try {
|
||||
for (var _b = __values(Array.from(set)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var mml = _c.value;
|
||||
var display = (this.adaptor.getAttribute(mml, 'display') === 'block' ||
|
||||
this.adaptor.getAttribute(mml, 'mode') === 'display');
|
||||
var start = { node: mml, n: 0, delim: '' };
|
||||
var end = { node: mml, n: 0, delim: '' };
|
||||
math.push({ math: this.adaptor.outerHTML(mml), start: start, end: end, display: display });
|
||||
}
|
||||
}
|
||||
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_5) throw e_5.error; }
|
||||
}
|
||||
return math;
|
||||
};
|
||||
FindMathML.OPTIONS = {};
|
||||
return FindMathML;
|
||||
}(FindMath_js_1.AbstractFindMath));
|
||||
exports.FindMathML = FindMathML;
|
||||
//# sourceMappingURL=FindMathML.js.map
|
||||
1
node_modules/mathjax-full/js/input/mathml/FindMathML.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/input/mathml/FindMathML.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FindMathML.js","sourceRoot":"","sources":["../../../ts/input/mathml/FindMathML.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,sDAAwD;AAQxD,IAAM,SAAS,GAAG,oCAAoC,CAAC;AAWvD;IAAyC,8BAAyB;IAAlE;;IAuFA,CAAC;IApEQ,6BAAQ,GAAf,UAAgB,IAAO;QACrB,IAAI,GAAG,GAAG,IAAI,GAAG,EAAK,CAAC;QACvB,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACjC,IAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtD,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,MAAM,IAAK,GAAG,CAAC,IAAI,KAAK,CAAC,EAAE;YACzD,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;SAC5B;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAQS,kCAAa,GAAvB,UAAwB,IAAO,EAAE,GAAW;;;Y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CAAW,GAArB,UAAsB,GAAW;;QAC/B,IAAI,IAAI,GAAsB,EAAE,CAAC;;YACjC,KAAkB,IAAA,KAAA,SAAA,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,gBAAA,4BAAE;gBAA9B,IAAM,GAAG,WAAA;gBACZ,IAAI,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,OAAO;oBACrD,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC;gBACrE,IAAI,KAAK,GAAG,EAAC,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC;gBACzC,IAAI,GAAG,GAAK,EAAC,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC;gBACzC,IAAI,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAK,OAAA,EAAE,GAAG,KAAA,EAAE,OAAO,SAAA,EAAC,CAAC,CAAC;aACrE;;;;;;;;;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAhFa,kBAAO,GAAe,EAAE,CAAC;IAkFzC,iBAAC;CAAA,AAvFD,CAAyC,8BAAgB,GAuFxD;AAvFY,gCAAU"}
|
||||
24
node_modules/mathjax-full/js/input/mathml/MathMLCompile.d.ts
generated
vendored
Normal file
24
node_modules/mathjax-full/js/input/mathml/MathMLCompile.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { MmlFactory } from '../../core/MmlTree/MmlFactory.js';
|
||||
import { MmlNode } from '../../core/MmlTree/MmlNode.js';
|
||||
import { OptionList } from '../../util/Options.js';
|
||||
import { DOMAdaptor } from '../../core/DOMAdaptor.js';
|
||||
export declare class MathMLCompile<N, T, D> {
|
||||
static OPTIONS: OptionList;
|
||||
adaptor: DOMAdaptor<N, T, D>;
|
||||
protected factory: MmlFactory;
|
||||
protected options: OptionList;
|
||||
constructor(options?: OptionList);
|
||||
setMmlFactory(mmlFactory: MmlFactory): void;
|
||||
compile(node: N): MmlNode;
|
||||
makeNode(node: N): MmlNode;
|
||||
protected addAttributes(mml: MmlNode, node: N): void;
|
||||
protected filterAttribute(_name: string, value: string): string;
|
||||
protected filterClassList(list: string[]): string[];
|
||||
protected addChildren(mml: MmlNode, node: N): void;
|
||||
protected addText(mml: MmlNode, child: N): void;
|
||||
protected checkClass(mml: MmlNode, node: N): void;
|
||||
protected fixCalligraphic(variant: string): string;
|
||||
protected markMrows(mml: MmlNode): void;
|
||||
protected trimSpace(text: string): string;
|
||||
protected error(message: string): void;
|
||||
}
|
||||
291
node_modules/mathjax-full/js/input/mathml/MathMLCompile.js
generated
vendored
Normal file
291
node_modules/mathjax-full/js/input/mathml/MathMLCompile.js
generated
vendored
Normal file
@@ -0,0 +1,291 @@
|
||||
"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 __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 __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.MathMLCompile = void 0;
|
||||
var MmlNode_js_1 = require("../../core/MmlTree/MmlNode.js");
|
||||
var Options_js_1 = require("../../util/Options.js");
|
||||
var Entities = __importStar(require("../../util/Entities.js"));
|
||||
var MathMLCompile = (function () {
|
||||
function MathMLCompile(options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
var Class = this.constructor;
|
||||
this.options = (0, Options_js_1.userOptions)((0, Options_js_1.defaultOptions)({}, Class.OPTIONS), options);
|
||||
}
|
||||
MathMLCompile.prototype.setMmlFactory = function (mmlFactory) {
|
||||
this.factory = mmlFactory;
|
||||
};
|
||||
MathMLCompile.prototype.compile = function (node) {
|
||||
var mml = this.makeNode(node);
|
||||
mml.verifyTree(this.options['verify']);
|
||||
mml.setInheritedAttributes({}, false, 0, false);
|
||||
mml.walkTree(this.markMrows);
|
||||
return mml;
|
||||
};
|
||||
MathMLCompile.prototype.makeNode = function (node) {
|
||||
var e_1, _a;
|
||||
var adaptor = this.adaptor;
|
||||
var limits = false;
|
||||
var kind = adaptor.kind(node).replace(/^.*:/, '');
|
||||
var texClass = adaptor.getAttribute(node, 'data-mjx-texclass') || '';
|
||||
if (texClass) {
|
||||
texClass = this.filterAttribute('data-mjx-texclass', texClass) || '';
|
||||
}
|
||||
var type = texClass && kind === 'mrow' ? 'TeXAtom' : kind;
|
||||
try {
|
||||
for (var _b = __values(this.filterClassList(adaptor.allClasses(node))), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var name_1 = _c.value;
|
||||
if (name_1.match(/^MJX-TeXAtom-/) && kind === 'mrow') {
|
||||
texClass = name_1.substr(12);
|
||||
type = 'TeXAtom';
|
||||
}
|
||||
else if (name_1 === 'MJX-fixedlimits') {
|
||||
limits = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
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.factory.getNodeClass(type) || this.error('Unknown node type "' + type + '"');
|
||||
var mml = this.factory.create(type);
|
||||
if (type === 'TeXAtom' && texClass === 'OP' && !limits) {
|
||||
mml.setProperty('movesupsub', true);
|
||||
mml.attributes.setInherited('movablelimits', true);
|
||||
}
|
||||
if (texClass) {
|
||||
mml.texClass = MmlNode_js_1.TEXCLASS[texClass];
|
||||
mml.setProperty('texClass', mml.texClass);
|
||||
}
|
||||
this.addAttributes(mml, node);
|
||||
this.checkClass(mml, node);
|
||||
this.addChildren(mml, node);
|
||||
return mml;
|
||||
};
|
||||
MathMLCompile.prototype.addAttributes = function (mml, node) {
|
||||
var e_2, _a;
|
||||
var ignoreVariant = false;
|
||||
try {
|
||||
for (var _b = __values(this.adaptor.allAttributes(node)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var attr = _c.value;
|
||||
var name_2 = attr.name;
|
||||
var value = this.filterAttribute(name_2, attr.value);
|
||||
if (value === null || name_2 === 'xmlns') {
|
||||
continue;
|
||||
}
|
||||
if (name_2.substr(0, 9) === 'data-mjx-') {
|
||||
switch (name_2.substr(9)) {
|
||||
case 'alternate':
|
||||
mml.setProperty('variantForm', true);
|
||||
break;
|
||||
case 'variant':
|
||||
mml.attributes.set('mathvariant', value);
|
||||
ignoreVariant = true;
|
||||
break;
|
||||
case 'smallmatrix':
|
||||
mml.setProperty('scriptlevel', 1);
|
||||
mml.setProperty('useHeight', false);
|
||||
break;
|
||||
case 'accent':
|
||||
mml.setProperty('mathaccent', value === 'true');
|
||||
break;
|
||||
case 'auto-op':
|
||||
mml.setProperty('autoOP', value === 'true');
|
||||
break;
|
||||
case 'script-align':
|
||||
mml.setProperty('scriptalign', value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (name_2 !== 'class') {
|
||||
var val = value.toLowerCase();
|
||||
if (val === 'true' || val === 'false') {
|
||||
mml.attributes.set(name_2, val === 'true');
|
||||
}
|
||||
else if (!ignoreVariant || name_2 !== 'mathvariant') {
|
||||
mml.attributes.set(name_2, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
};
|
||||
MathMLCompile.prototype.filterAttribute = function (_name, value) {
|
||||
return value;
|
||||
};
|
||||
MathMLCompile.prototype.filterClassList = function (list) {
|
||||
return list;
|
||||
};
|
||||
MathMLCompile.prototype.addChildren = function (mml, node) {
|
||||
var e_3, _a;
|
||||
if (mml.arity === 0) {
|
||||
return;
|
||||
}
|
||||
var adaptor = this.adaptor;
|
||||
try {
|
||||
for (var _b = __values(adaptor.childNodes(node)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var child = _c.value;
|
||||
var name_3 = adaptor.kind(child);
|
||||
if (name_3 === '#comment') {
|
||||
continue;
|
||||
}
|
||||
if (name_3 === '#text') {
|
||||
this.addText(mml, child);
|
||||
}
|
||||
else if (mml.isKind('annotation-xml')) {
|
||||
mml.appendChild(this.factory.create('XML').setXML(child, adaptor));
|
||||
}
|
||||
else {
|
||||
var childMml = mml.appendChild(this.makeNode(child));
|
||||
if (childMml.arity === 0 && adaptor.childNodes(child).length) {
|
||||
if (this.options['fixMisplacedChildren']) {
|
||||
this.addChildren(mml, child);
|
||||
}
|
||||
else {
|
||||
childMml.mError('There should not be children for ' + childMml.kind + ' nodes', this.options['verify'], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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; }
|
||||
}
|
||||
};
|
||||
MathMLCompile.prototype.addText = function (mml, child) {
|
||||
var text = this.adaptor.value(child);
|
||||
if ((mml.isToken || mml.getProperty('isChars')) && mml.arity) {
|
||||
if (mml.isToken) {
|
||||
text = Entities.translate(text);
|
||||
text = this.trimSpace(text);
|
||||
}
|
||||
mml.appendChild(this.factory.create('text').setText(text));
|
||||
}
|
||||
else if (text.match(/\S/)) {
|
||||
this.error('Unexpected text node "' + text + '"');
|
||||
}
|
||||
};
|
||||
MathMLCompile.prototype.checkClass = function (mml, node) {
|
||||
var e_4, _a;
|
||||
var classList = [];
|
||||
try {
|
||||
for (var _b = __values(this.filterClassList(this.adaptor.allClasses(node))), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var name_4 = _c.value;
|
||||
if (name_4.substr(0, 4) === 'MJX-') {
|
||||
if (name_4 === 'MJX-variant') {
|
||||
mml.setProperty('variantForm', true);
|
||||
}
|
||||
else if (name_4.substr(0, 11) !== 'MJX-TeXAtom') {
|
||||
mml.attributes.set('mathvariant', this.fixCalligraphic(name_4.substr(3)));
|
||||
}
|
||||
}
|
||||
else {
|
||||
classList.push(name_4);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_4) throw e_4.error; }
|
||||
}
|
||||
if (classList.length) {
|
||||
mml.attributes.set('class', classList.join(' '));
|
||||
}
|
||||
};
|
||||
MathMLCompile.prototype.fixCalligraphic = function (variant) {
|
||||
return variant.replace(/caligraphic/, 'calligraphic');
|
||||
};
|
||||
MathMLCompile.prototype.markMrows = function (mml) {
|
||||
if (mml.isKind('mrow') && !mml.isInferred && mml.childNodes.length >= 2) {
|
||||
var first = mml.childNodes[0];
|
||||
var last = mml.childNodes[mml.childNodes.length - 1];
|
||||
if (first.isKind('mo') && first.attributes.get('fence') && first.attributes.get('stretchy') &&
|
||||
last.isKind('mo') && last.attributes.get('fence') && last.attributes.get('stretchy')) {
|
||||
if (first.childNodes.length) {
|
||||
mml.setProperty('open', first.getText());
|
||||
}
|
||||
if (last.childNodes.length) {
|
||||
mml.setProperty('close', last.getText());
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
MathMLCompile.prototype.trimSpace = function (text) {
|
||||
return text.replace(/[\t\n\r]/g, ' ')
|
||||
.replace(/^ +/, '')
|
||||
.replace(/ +$/, '')
|
||||
.replace(/ +/g, ' ');
|
||||
};
|
||||
MathMLCompile.prototype.error = function (message) {
|
||||
throw new Error(message);
|
||||
};
|
||||
MathMLCompile.OPTIONS = {
|
||||
MmlFactory: null,
|
||||
fixMisplacedChildren: true,
|
||||
verify: __assign({}, MmlNode_js_1.AbstractMmlNode.verifyDefaults),
|
||||
translateEntities: true
|
||||
};
|
||||
return MathMLCompile;
|
||||
}());
|
||||
exports.MathMLCompile = MathMLCompile;
|
||||
//# sourceMappingURL=MathMLCompile.js.map
|
||||
1
node_modules/mathjax-full/js/input/mathml/MathMLCompile.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/input/mathml/MathMLCompile.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
node_modules/mathjax-full/js/input/mathml/mml3/mml3-node.d.ts
generated
vendored
Normal file
2
node_modules/mathjax-full/js/input/mathml/mml3/mml3-node.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { MathDocument } from '../../../core/MathDocument.js';
|
||||
export declare function createTransform<N, T, D>(): (node: N, doc: MathDocument<N, T, D>) => N;
|
||||
39
node_modules/mathjax-full/js/input/mathml/mml3/mml3-node.js
generated
vendored
Normal file
39
node_modules/mathjax-full/js/input/mathml/mml3/mml3-node.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createTransform = void 0;
|
||||
function createTransform() {
|
||||
var nodeRequire = eval('require');
|
||||
var dirname = eval('__dirname');
|
||||
try {
|
||||
nodeRequire.resolve('saxon-js');
|
||||
}
|
||||
catch (err) {
|
||||
throw Error('Saxon-js not found. Run the command:\n npm install saxon-js\nand try again.');
|
||||
}
|
||||
var Saxon = nodeRequire('saxon-js');
|
||||
var path = nodeRequire('path');
|
||||
var fs = nodeRequire('fs');
|
||||
var xsltFile = path.resolve(dirname, 'mml3.sef.json');
|
||||
var xslt = JSON.parse(fs.readFileSync(xsltFile));
|
||||
return function (node, doc) {
|
||||
var adaptor = doc.adaptor;
|
||||
var mml = adaptor.outerHTML(node);
|
||||
if (!mml.match(/ xmlns[=:]/)) {
|
||||
mml = mml.replace(/<(?:(\w+)(:))?math/, '<$1$2math xmlns$2$1="http://www.w3.org/1998/Math/MathML"');
|
||||
}
|
||||
var result;
|
||||
try {
|
||||
result = adaptor.firstChild(adaptor.body(adaptor.parse(Saxon.transform({
|
||||
stylesheetInternal: xslt,
|
||||
sourceText: mml,
|
||||
destination: 'serialized'
|
||||
}).principalResult)));
|
||||
}
|
||||
catch (err) {
|
||||
result = node;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
exports.createTransform = createTransform;
|
||||
//# sourceMappingURL=mml3-node.js.map
|
||||
1
node_modules/mathjax-full/js/input/mathml/mml3/mml3-node.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/input/mathml/mml3/mml3-node.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"mml3-node.js","sourceRoot":"","sources":["../../../../ts/input/mathml/mml3/mml3-node.ts"],"names":[],"mappings":";;;AAoCA,SAAgB,eAAe;IAE7B,IAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;IAEpC,IAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;IAClC,IAAI;QACF,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;KACjC;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,KAAK,CAAC,iFAAiF,CAAC,CAAC;KAChG;IACD,IAAM,KAAK,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IACtC,IAAM,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,IAAM,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACxD,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnD,OAAO,UAAC,IAAO,EAAE,GAA0B;QACzC,IAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAC5B,IAAI,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAIlC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;YAC5B,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,oBAAoB,EAAE,0DAA0D,CAAC,CAAC;SACrG;QAID,IAAI,MAAM,CAAC;QACX,IAAI;YACF,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC;gBACrE,kBAAkB,EAAE,IAAI;gBACxB,UAAU,EAAE,GAAG;gBACf,WAAW,EAAE,YAAY;aAC1B,CAAC,CAAC,eAAe,CAAC,CAAC,CAAM,CAAC;SAC5B;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,GAAG,IAAI,CAAC;SACf;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAvCD,0CAuCC"}
|
||||
15
node_modules/mathjax-full/js/input/mathml/mml3/mml3.d.ts
generated
vendored
Normal file
15
node_modules/mathjax-full/js/input/mathml/mml3/mml3.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { MathItem } from '../../../core/MathItem.js';
|
||||
import { MathDocument } from '../../../core/MathDocument.js';
|
||||
import { Handler } from '../../../core/Handler.js';
|
||||
export declare type FILTERDATA<N, T, D> = {
|
||||
math: MathItem<N, T, D>;
|
||||
document: MathDocument<N, T, D>;
|
||||
data: N;
|
||||
};
|
||||
export declare class Mml3<N, T, D> {
|
||||
static XSLT: string;
|
||||
protected transform: (node: N, doc: MathDocument<N, T, D>) => N;
|
||||
constructor(document: MathDocument<N, T, D>);
|
||||
mmlFilter(args: FILTERDATA<N, T, D>): void;
|
||||
}
|
||||
export declare function Mml3Handler<N, T, D>(handler: Handler<N, T, D>): Handler<N, T, D>;
|
||||
133
node_modules/mathjax-full/js/input/mathml/mml3/mml3.js
generated
vendored
Normal file
133
node_modules/mathjax-full/js/input/mathml/mml3/mml3.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/mathjax-full/js/input/mathml/mml3/mml3.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/input/mathml/mml3/mml3.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"mml3.js","sourceRoot":"","s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,aAAa;YAAiB,2BAAqB;YAgBzD;;gBAAY,cAAc;qBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;oBAAd,yBAAc;;gBAA1B,wDACW,IAAI,mBAWd;;oBAVC,KAAkB,IAAA,KAAA,SAAA,KAAI,CAAC,QAAQ,IAAI,EAAE,CAAA,gBAAA,4BAAE;wBAAlC,IAAM,GAAG,WAAA;wBACZ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;4BACzB,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE;gCACtB,IAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAI,CAAC,CAAC;gCAC3B,GAAuB,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;gCACnE,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;6BAC1B;4BACD,MAAM;yBACP;qBACF;;;;;;;;;;YACH,CAAC;YACH,cAAC;QAAD,CAAC,AA7BuB,CAAc,OAAO,CAAC,aAAa;QAK3C,UAAO,yBAChB,OAAO,CAAC,aAAa,CAAC,OAAO,KAChC,UAAU,EAAE,IAAI,GAChB;WAqBH,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC;AAhCD,kCAgCC;AAKD,IAAI,CAAC,IAAI,GAAG,gjxBA8pBX,CAAC"}
|
||||
1
node_modules/mathjax-full/js/input/mathml/mml3/mml3.sef.json
generated
vendored
Normal file
1
node_modules/mathjax-full/js/input/mathml/mml3/mml3.sef.json
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user