asciimath.js 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = function (d, b) {
  4. extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  7. return extendStatics(d, b);
  8. };
  9. return function (d, b) {
  10. if (typeof b !== "function" && b !== null)
  11. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  12. extendStatics(d, b);
  13. function __() { this.constructor = d; }
  14. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15. };
  16. })();
  17. var __assign = (this && this.__assign) || function () {
  18. __assign = Object.assign || function(t) {
  19. for (var s, i = 1, n = arguments.length; i < n; i++) {
  20. s = arguments[i];
  21. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  22. t[p] = s[p];
  23. }
  24. return t;
  25. };
  26. return __assign.apply(this, arguments);
  27. };
  28. var __read = (this && this.__read) || function (o, n) {
  29. var m = typeof Symbol === "function" && o[Symbol.iterator];
  30. if (!m) return o;
  31. var i = m.call(o), r, ar = [], e;
  32. try {
  33. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  34. }
  35. catch (error) { e = { error: error }; }
  36. finally {
  37. try {
  38. if (r && !r.done && (m = i["return"])) m.call(i);
  39. }
  40. finally { if (e) throw e.error; }
  41. }
  42. return ar;
  43. };
  44. Object.defineProperty(exports, "__esModule", { value: true });
  45. exports.AsciiMath = void 0;
  46. var InputJax_js_1 = require("../core/InputJax.js");
  47. var AsciiMath_js_1 = require("./asciimath/mathjax2/input/AsciiMath.js");
  48. var Options_js_1 = require("../util/Options.js");
  49. var FindAsciiMath_js_1 = require("./asciimath/FindAsciiMath.js");
  50. var AsciiMath = (function (_super) {
  51. __extends(AsciiMath, _super);
  52. function AsciiMath(options) {
  53. var _this = this;
  54. var _a = __read((0, Options_js_1.separateOptions)(options, FindAsciiMath_js_1.FindAsciiMath.OPTIONS, AsciiMath.OPTIONS), 3), find = _a[1], am = _a[2];
  55. _this = _super.call(this, am) || this;
  56. _this.findAsciiMath = _this.options['FindAsciiMath'] || new FindAsciiMath_js_1.FindAsciiMath(find);
  57. return _this;
  58. }
  59. AsciiMath.prototype.compile = function (math, _document) {
  60. return AsciiMath_js_1.LegacyAsciiMath.Compile(math.math, math.display);
  61. };
  62. AsciiMath.prototype.findMath = function (strings) {
  63. return this.findAsciiMath.findMath(strings);
  64. };
  65. AsciiMath.NAME = 'AsciiMath';
  66. AsciiMath.OPTIONS = __assign(__assign({}, InputJax_js_1.AbstractInputJax.OPTIONS), { FindAsciiMath: null });
  67. return AsciiMath;
  68. }(InputJax_js_1.AbstractInputJax));
  69. exports.AsciiMath = AsciiMath;
  70. //# sourceMappingURL=asciimath.js.map