UNPKG

@qtikit/mathml-to-latex

Version:

A JavaScript tool to convert mathml string to LaTeX string

28 lines (27 loc) 997 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MSpace = void 0; var helpers_1 = require("../../../helpers"); var MSpace = /** @class */ (function () { function MSpace(mathElement) { this._mathmlElement = mathElement; } MSpace.prototype.convert = function () { var latexJoinedChildren = this._mathmlElement.children .map(function (child) { return (0, helpers_1.mathMLElementToLaTeXConverter)(child); }) .map(function (converter) { return converter.convert(); }) .join(' '); if (this._linebreak === 'newline') return "\\\\".concat(latexJoinedChildren); return latexJoinedChildren; }; Object.defineProperty(MSpace.prototype, "_linebreak", { get: function () { return this._mathmlElement.attributes.linebreak || 'auto'; }, enumerable: false, configurable: true }); return MSpace; }()); exports.MSpace = MSpace;