element containing node, or null if not found.
-
-function closestKatex(node) {
- // If node is a Text Node, for example, go up to containing Element,
- // where we can apply the `closest` method.
- var element = node instanceof Element ? node : node.parentElement;
- return element && element.closest('.katex');
-} // Global copy handler to modify behavior on/within .katex elements.
-
-
-document.addEventListener('copy', function (event) {
- var selection = window.getSelection();
-
- if (selection.isCollapsed || !event.clipboardData) {
- return; // default action OK if selection is empty or unchangeable
- }
-
- var clipboardData = event.clipboardData;
- var range = selection.getRangeAt(0); // When start point is within a formula, expand to entire formula.
-
- var startKatex = closestKatex(range.startContainer);
-
- if (startKatex) {
- range.setStartBefore(startKatex);
- } // Similarly, when end point is within a formula, expand to entire formula.
-
-
- var endKatex = closestKatex(range.endContainer);
-
- if (endKatex) {
- range.setEndAfter(endKatex);
- }
-
- var fragment = range.cloneContents();
-
- if (!fragment.querySelector('.katex-mathml')) {
- return; // default action OK if no .katex-mathml elements
- }
-
- var htmlContents = Array.prototype.map.call(fragment.childNodes, function (el) {
- return el instanceof Text ? el.textContent : el.outerHTML;
- }).join(''); // Preserve usual HTML copy/paste behavior.
-
- clipboardData.setData('text/html', htmlContents); // Rewrite plain-text version.
-
- clipboardData.setData('text/plain', katex2tex(fragment).textContent); // Prevent normal copy handling.
-
- event.preventDefault();
-});
-__webpack_exports__ = __webpack_exports__["default"];
-/******/ return __webpack_exports__;
-/******/ })()
-;
-});
\ No newline at end of file
diff --git a/javascripts/katex/contrib/copy-tex.min.js b/javascripts/katex/contrib/copy-tex.min.js
deleted file mode 100644
index 5a1ec34..0000000
--- a/javascripts/katex/contrib/copy-tex.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={},t={inline:["$","$"],display:["$$","$$"]};var n=function(e,n){void 0===n&&(n=t);for(var r=e.querySelectorAll(".katex-mathml + .katex-html"),a=0;a
element).
-// Modifies fragment in-place. Useful for writing your own 'copy' handler,
-// as in copy-tex.js.
-
-function katexReplaceWithTex(fragment, copyDelimiters) {
- if (copyDelimiters === void 0) {
- copyDelimiters = defaultCopyDelimiters;
- }
-
- // Remove .katex-html blocks that are preceded by .katex-mathml blocks
- // (which will get replaced below).
- var katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html');
-
- for (var i = 0; i < katexHtml.length; i++) {
- var element = katexHtml[i];
-
- if (element.remove) {
- element.remove();
- } else if (element.parentNode) {
- element.parentNode.removeChild(element);
- }
- } // Replace .katex-mathml elements with their annotation (TeX source)
- // descendant, with inline delimiters.
-
-
- var katexMathml = fragment.querySelectorAll('.katex-mathml');
-
- for (var _i = 0; _i < katexMathml.length; _i++) {
- var _element = katexMathml[_i];
-
- var texSource = _element.querySelector('annotation');
-
- if (texSource) {
- if (_element.replaceWith) {
- _element.replaceWith(texSource);
- } else if (_element.parentNode) {
- _element.parentNode.replaceChild(texSource, _element);
- }
-
- texSource.innerHTML = copyDelimiters.inline[0] + texSource.innerHTML + copyDelimiters.inline[1];
- }
- } // Switch display math to display delimiters.
-
-
- var displays = fragment.querySelectorAll('.katex-display annotation');
-
- for (var _i2 = 0; _i2 < displays.length; _i2++) {
- var _element2 = displays[_i2];
- _element2.innerHTML = copyDelimiters.display[0] + _element2.innerHTML.substr(copyDelimiters.inline[0].length, _element2.innerHTML.length - copyDelimiters.inline[0].length - copyDelimiters.inline[1].length) + copyDelimiters.display[1];
- }
-
- return fragment;
-}
-
-function closestKatex(node) {
- // If node is a Text Node, for example, go up to containing Element,
- // where we can apply the `closest` method.
- var element = node instanceof Element ? node : node.parentElement;
- return element && element.closest('.katex');
-} // Global copy handler to modify behavior on/within .katex elements.
-
-
-document.addEventListener('copy', function (event) {
- var selection = window.getSelection();
-
- if (selection.isCollapsed || !event.clipboardData) {
- return; // default action OK if selection is empty or unchangeable
- }
-
- var clipboardData = event.clipboardData;
- var range = selection.getRangeAt(0); // When start point is within a formula, expand to entire formula.
-
- var startKatex = closestKatex(range.startContainer);
-
- if (startKatex) {
- range.setStartBefore(startKatex);
- } // Similarly, when end point is within a formula, expand to entire formula.
-
-
- var endKatex = closestKatex(range.endContainer);
-
- if (endKatex) {
- range.setEndAfter(endKatex);
- }
-
- var fragment = range.cloneContents();
-
- if (!fragment.querySelector('.katex-mathml')) {
- return; // default action OK if no .katex-mathml elements
- }
-
- var htmlContents = Array.prototype.map.call(fragment.childNodes, el => el instanceof Text ? el.textContent : el.outerHTML).join(''); // Preserve usual HTML copy/paste behavior.
-
- clipboardData.setData('text/html', htmlContents); // Rewrite plain-text version.
-
- clipboardData.setData('text/plain', katexReplaceWithTex(fragment).textContent); // Prevent normal copy handling.
-
- event.preventDefault();
-});
diff --git a/javascripts/katex/contrib/mathtex-script-type.js b/javascripts/katex/contrib/mathtex-script-type.js
deleted file mode 100644
index d82c41d..0000000
--- a/javascripts/katex/contrib/mathtex-script-type.js
+++ /dev/null
@@ -1,112 +0,0 @@
-(function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory(require("katex"));
- else if(typeof define === 'function' && define.amd)
- define(["katex"], factory);
- else {
- var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]);
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
- }
-})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__771__) {
-return /******/ (function() { // webpackBootstrap
-/******/ "use strict";
-/******/ var __webpack_modules__ = ({
-
-/***/ 771:
-/***/ (function(module) {
-
-module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/compat get default export */
-/******/ !function() {
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = function(module) {
-/******/ var getter = module && module.__esModule ?
-/******/ function() { return module['default']; } :
-/******/ function() { return module; };
-/******/ __webpack_require__.d(getter, { a: getter });
-/******/ return getter;
-/******/ };
-/******/ }();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ !function() {
-/******/ // define getter functions for harmony exports
-/******/ __webpack_require__.d = function(exports, definition) {
-/******/ for(var key in definition) {
-/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
-/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
-/******/ }
-/******/ }
-/******/ };
-/******/ }();
-/******/
-/******/ /* webpack/runtime/hasOwnProperty shorthand */
-/******/ !function() {
-/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
-/******/ }();
-/******/
-/************************************************************************/
-var __webpack_exports__ = {};
-// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
-!function() {
-/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(771);
-/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__);
-
-var scripts = document.body.getElementsByTagName("script");
-scripts = Array.prototype.slice.call(scripts);
-scripts.forEach(function (script) {
- if (!script.type || !script.type.match(/math\/tex/i)) {
- return -1;
- }
-
- var display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null;
- var katexElement = document.createElement(display ? "div" : "span");
- katexElement.setAttribute("class", display ? "equation" : "inline-equation");
-
- try {
- katex__WEBPACK_IMPORTED_MODULE_0___default().render(script.text, katexElement, {
- displayMode: display
- });
- } catch (err) {
- //console.error(err); linter doesn't like this
- katexElement.textContent = script.text;
- }
-
- script.parentNode.replaceChild(katexElement, script);
-});
-}();
-__webpack_exports__ = __webpack_exports__["default"];
-/******/ return __webpack_exports__;
-/******/ })()
-;
-});
\ No newline at end of file
diff --git a/javascripts/katex/contrib/mathtex-script-type.min.js b/javascripts/katex/contrib/mathtex-script-type.min.js
deleted file mode 100644
index af02830..0000000
--- a/javascripts/katex/contrib/mathtex-script-type.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],t);else{var r="object"==typeof exports?t(require("katex")):t(e.katex);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o,i,a,u={};return o=n(771),i=n.n(o),a=document.body.getElementsByTagName("script"),(a=Array.prototype.slice.call(a)).forEach((function(e){if(!e.type||!e.type.match(/math\/tex/i))return-1;var t=null!=e.type.match(/mode\s*=\s*display(;|\s|\n|$)/),r=document.createElement(t?"div":"span");r.setAttribute("class",t?"equation":"inline-equation");try{i().render(e.text,r,{displayMode:t})}catch(t){r.textContent=e.text}e.parentNode.replaceChild(r,e)})),u=u.default}()}));
\ No newline at end of file
diff --git a/javascripts/katex/contrib/mathtex-script-type.mjs b/javascripts/katex/contrib/mathtex-script-type.mjs
deleted file mode 100644
index 1083b92..0000000
--- a/javascripts/katex/contrib/mathtex-script-type.mjs
+++ /dev/null
@@ -1,24 +0,0 @@
-import katex from '../katex.mjs';
-
-var scripts = document.body.getElementsByTagName("script");
-scripts = Array.prototype.slice.call(scripts);
-scripts.forEach(function (script) {
- if (!script.type || !script.type.match(/math\/tex/i)) {
- return -1;
- }
-
- var display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null;
- var katexElement = document.createElement(display ? "div" : "span");
- katexElement.setAttribute("class", display ? "equation" : "inline-equation");
-
- try {
- katex.render(script.text, katexElement, {
- displayMode: display
- });
- } catch (err) {
- //console.error(err); linter doesn't like this
- katexElement.textContent = script.text;
- }
-
- script.parentNode.replaceChild(katexElement, script);
-});
diff --git a/javascripts/katex/contrib/mhchem.js b/javascripts/katex/contrib/mhchem.js
deleted file mode 100644
index 8b49131..0000000
--- a/javascripts/katex/contrib/mhchem.js
+++ /dev/null
@@ -1,3216 +0,0 @@
-(function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory(require("katex"));
- else if(typeof define === 'function' && define.amd)
- define(["katex"], factory);
- else {
- var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]);
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
- }
-})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__771__) {
-return /******/ (function() { // webpackBootstrap
-/******/ "use strict";
-/******/ var __webpack_modules__ = ({
-
-/***/ 771:
-/***/ (function(module) {
-
-module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/compat get default export */
-/******/ !function() {
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = function(module) {
-/******/ var getter = module && module.__esModule ?
-/******/ function() { return module['default']; } :
-/******/ function() { return module; };
-/******/ __webpack_require__.d(getter, { a: getter });
-/******/ return getter;
-/******/ };
-/******/ }();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ !function() {
-/******/ // define getter functions for harmony exports
-/******/ __webpack_require__.d = function(exports, definition) {
-/******/ for(var key in definition) {
-/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
-/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
-/******/ }
-/******/ }
-/******/ };
-/******/ }();
-/******/
-/******/ /* webpack/runtime/hasOwnProperty shorthand */
-/******/ !function() {
-/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
-/******/ }();
-/******/
-/************************************************************************/
-var __webpack_exports__ = {};
-// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
-!function() {
-/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(771);
-/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__);
-/* eslint-disable */
-
-/* -*- Mode: JavaScript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
-
-/* vim: set ts=2 et sw=2 tw=80: */
-
-/*************************************************************
- *
- * KaTeX mhchem.js
- *
- * This file implements a KaTeX version of mhchem version 3.3.0.
- * It is adapted from MathJax/extensions/TeX/mhchem.js
- * It differs from the MathJax version as follows:
- * 1. The interface is changed so that it can be called from KaTeX, not MathJax.
- * 2. \rlap and \llap are replaced with \mathrlap and \mathllap.
- * 3. Four lines of code are edited in order to use \raisebox instead of \raise.
- * 4. The reaction arrow code is simplified. All reaction arrows are rendered
- * using KaTeX extensible arrows instead of building non-extensible arrows.
- * 5. \tripledash vertical alignment is slightly adjusted.
- *
- * This code, as other KaTeX code, is released under the MIT license.
- *
- * /*************************************************************
- *
- * MathJax/extensions/TeX/mhchem.js
- *
- * Implements the \ce command for handling chemical formulas
- * from the mhchem LaTeX package.
- *
- * ---------------------------------------------------------------------
- *
- * Copyright (c) 2011-2015 The MathJax Consortium
- * Copyright (c) 2015-2018 Martin Hensel
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-// Coding Style
-// - use '' for identifiers that can by minified/uglified
-// - use "" for strings that need to stay untouched
-// version: "3.3.0" for MathJax and KaTeX
-// Add \ce, \pu, and \tripledash to the KaTeX macros.
-katex__WEBPACK_IMPORTED_MODULE_0___default().__defineMacro("\\ce", function (context) {
- return chemParse(context.consumeArgs(1)[0], "ce");
-});
-
-katex__WEBPACK_IMPORTED_MODULE_0___default().__defineMacro("\\pu", function (context) {
- return chemParse(context.consumeArgs(1)[0], "pu");
-}); // Needed for \bond for the ~ forms
-// Raise by 2.56mu, not 2mu. We're raising a hyphen-minus, U+002D, not
-// a mathematical minus, U+2212. So we need that extra 0.56.
-
-
-katex__WEBPACK_IMPORTED_MODULE_0___default().__defineMacro("\\tripledash", "{\\vphantom{-}\\raisebox{2.56mu}{$\\mkern2mu" + "\\tiny\\text{-}\\mkern1mu\\text{-}\\mkern1mu\\text{-}\\mkern2mu$}}");
-
- //
-// This is the main function for handing the \ce and \pu commands.
-// It takes the argument to \ce or \pu and returns the corresponding TeX string.
-//
-
-var chemParse = function chemParse(tokens, stateMachine) {
- // Recreate the argument string from KaTeX's array of tokens.
- var str = "";
- var expectedLoc = tokens.length && tokens[tokens.length - 1].loc.start;
-
- for (var i = tokens.length - 1; i >= 0; i--) {
- if (tokens[i].loc.start > expectedLoc) {
- // context.consumeArgs has eaten a space.
- str += " ";
- expectedLoc = tokens[i].loc.start;
- }
-
- str += tokens[i].text;
- expectedLoc += tokens[i].text.length;
- }
-
- var tex = texify.go(mhchemParser.go(str, stateMachine));
- return tex;
-}; //
-// Core parser for mhchem syntax (recursive)
-//
-
-/** @type {MhchemParser} */
-
-
-var mhchemParser = {
- //
- // Parses mchem \ce syntax
- //
- // Call like
- // go("H2O");
- //
- go: function go(input, stateMachine) {
- if (!input) {
- return [];
- }
-
- if (stateMachine === undefined) {
- stateMachine = 'ce';
- }
-
- var state = '0'; //
- // String buffers for parsing:
- //
- // buffer.a == amount
- // buffer.o == element
- // buffer.b == left-side superscript
- // buffer.p == left-side subscript
- // buffer.q == right-side subscript
- // buffer.d == right-side superscript
- //
- // buffer.r == arrow
- // buffer.rdt == arrow, script above, type
- // buffer.rd == arrow, script above, content
- // buffer.rqt == arrow, script below, type
- // buffer.rq == arrow, script below, content
- //
- // buffer.text_
- // buffer.rm
- // etc.
- //
- // buffer.parenthesisLevel == int, starting at 0
- // buffer.sb == bool, space before
- // buffer.beginsWithBond == bool
- //
- // These letters are also used as state names.
- //
- // Other states:
- // 0 == begin of main part (arrow/operator unlikely)
- // 1 == next entity
- // 2 == next entity (arrow/operator unlikely)
- // 3 == next atom
- // c == macro
- //
-
- /** @type {Buffer} */
-
- var buffer = {};
- buffer['parenthesisLevel'] = 0;
- input = input.replace(/\n/g, " ");
- input = input.replace(/[\u2212\u2013\u2014\u2010]/g, "-");
- input = input.replace(/[\u2026]/g, "..."); //
- // Looks through mhchemParser.transitions, to execute a matching action
- // (recursive)
- //
-
- var lastInput;
- var watchdog = 10;
- /** @type {ParserOutput[]} */
-
- var output = [];
-
- while (true) {
- if (lastInput !== input) {
- watchdog = 10;
- lastInput = input;
- } else {
- watchdog--;
- } //
- // Find actions in transition table
- //
-
-
- var machine = mhchemParser.stateMachines[stateMachine];
- var t = machine.transitions[state] || machine.transitions['*'];
-
- iterateTransitions: for (var i = 0; i < t.length; i++) {
- var matches = mhchemParser.patterns.match_(t[i].pattern, input);
-
- if (matches) {
- //
- // Execute actions
- //
- var task = t[i].task;
-
- for (var iA = 0; iA < task.action_.length; iA++) {
- var o; //
- // Find and execute action
- //
-
- if (machine.actions[task.action_[iA].type_]) {
- o = machine.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
- } else if (mhchemParser.actions[task.action_[iA].type_]) {
- o = mhchemParser.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
- } else {
- throw ["MhchemBugA", "mhchem bug A. Please report. (" + task.action_[iA].type_ + ")"]; // Trying to use non-existing action
- } //
- // Add output
- //
-
-
- mhchemParser.concatArray(output, o);
- } //
- // Set next state,
- // Shorten input,
- // Continue with next character
- // (= apply only one transition per position)
- //
-
-
- state = task.nextState || state;
-
- if (input.length > 0) {
- if (!task.revisit) {
- input = matches.remainder;
- }
-
- if (!task.toContinue) {
- break iterateTransitions;
- }
- } else {
- return output;
- }
- }
- } //
- // Prevent infinite loop
- //
-
-
- if (watchdog <= 0) {
- throw ["MhchemBugU", "mhchem bug U. Please report."]; // Unexpected character
- }
- }
- },
- concatArray: function concatArray(a, b) {
- if (b) {
- if (Array.isArray(b)) {
- for (var iB = 0; iB < b.length; iB++) {
- a.push(b[iB]);
- }
- } else {
- a.push(b);
- }
- }
- },
- patterns: {
- //
- // Matching patterns
- // either regexps or function that return null or {match_:"a", remainder:"bc"}
- //
- patterns: {
- // property names must not look like integers ("2") for correct property traversal order, later on
- 'empty': /^$/,
- 'else': /^./,
- 'else2': /^./,
- 'space': /^\s/,
- 'space A': /^\s(?=[A-Z\\$])/,
- 'space$': /^\s$/,
- 'a-z': /^[a-z]/,
- 'x': /^x/,
- 'x$': /^x$/,
- 'i$': /^i$/,
- 'letters': /^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,
- '\\greek': /^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,
- 'one lowercase latin letter $': /^(?:([a-z])(?:$|[^a-zA-Z]))$/,
- '$one lowercase latin letter$ $': /^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,
- 'one lowercase greek letter $': /^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,
- 'digits': /^[0-9]+/,
- '-9.,9': /^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,
- '-9.,9 no missing 0': /^[+\-]?[0-9]+(?:[.,][0-9]+)?/,
- '(-)(9.,9)(e)(99)': function e99(input) {
- var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);
-
- if (m && m[0]) {
- return {
- match_: m.splice(1),
- remainder: input.substr(m[0].length)
- };
- }
-
- return null;
- },
- '(-)(9)^(-9)': function _(input) {
- var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);
-
- if (m && m[0]) {
- return {
- match_: m.splice(1),
- remainder: input.substr(m[0].length)
- };
- }
-
- return null;
- },
- 'state of aggregation $': function stateOfAggregation$(input) {
- // ... or crystal system
- var a = mhchemParser.patterns.findObserveGroups(input, "", /^\([a-z]{1,3}(?=[\),])/, ")", ""); // (aq), (aq,$\infty$), (aq, sat)
-
- if (a && a.remainder.match(/^($|[\s,;\)\]\}])/)) {
- return a;
- } // AND end of 'phrase'
-
-
- var m = input.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/); // OR crystal system ($o$) (\ca$c$)
-
- if (m) {
- return {
- match_: m[0],
- remainder: input.substr(m[0].length)
- };
- }
-
- return null;
- },
- '_{(state of aggregation)}$': /^_\{(\([a-z]{1,3}\))\}/,
- '{[(': /^(?:\\\{|\[|\()/,
- ')]}': /^(?:\)|\]|\\\})/,
- ', ': /^[,;]\s*/,
- ',': /^[,;]/,
- '.': /^[.]/,
- '. ': /^([.\u22C5\u00B7\u2022])\s*/,
- '...': /^\.\.\.(?=$|[^.])/,
- '* ': /^([*])\s*/,
- '^{(...)}': function _(input) {
- return mhchemParser.patterns.findObserveGroups(input, "^{", "", "", "}");
- },
- '^($...$)': function $$(input) {
- return mhchemParser.patterns.findObserveGroups(input, "^", "$", "$", "");
- },
- '^a': /^\^([0-9]+|[^\\_])/,
- '^\\x{}{}': function x(input) {
- return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
- },
- '^\\x{}': function x(input) {
- return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", "");
- },
- '^\\x': /^\^(\\[a-zA-Z]+)\s*/,
- '^(-1)': /^\^(-?\d+)/,
- '\'': /^'/,
- '_{(...)}': function _(input) {
- return mhchemParser.patterns.findObserveGroups(input, "_{", "", "", "}");
- },
- '_($...$)': function _$$(input) {
- return mhchemParser.patterns.findObserveGroups(input, "_", "$", "$", "");
- },
- '_9': /^_([+\-]?[0-9]+|[^\\])/,
- '_\\x{}{}': function _X(input) {
- return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
- },
- '_\\x{}': function _X(input) {
- return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", "");
- },
- '_\\x': /^_(\\[a-zA-Z]+)\s*/,
- '^_': /^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,
- '{}': /^\{\}/,
- '{...}': function _(input) {
- return mhchemParser.patterns.findObserveGroups(input, "", "{", "}", "");
- },
- '{(...)}': function _(input) {
- return mhchemParser.patterns.findObserveGroups(input, "{", "", "", "}");
- },
- '$...$': function $$(input) {
- return mhchemParser.patterns.findObserveGroups(input, "", "$", "$", "");
- },
- '${(...)}$': function $$(input) {
- return mhchemParser.patterns.findObserveGroups(input, "${", "", "", "}$");
- },
- '$(...)$': function $$(input) {
- return mhchemParser.patterns.findObserveGroups(input, "$", "", "", "$");
- },
- '=<>': /^[=<>]/,
- '#': /^[#\u2261]/,
- '+': /^\+/,
- '-$': /^-(?=[\s_},;\]/]|$|\([a-z]+\))/,
- // -space -, -; -] -/ -$ -state-of-aggregation
- '-9': /^-(?=[0-9])/,
- '- orbital overlap': /^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,
- '-': /^-/,
- 'pm-operator': /^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,
- 'operator': /^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,
- 'arrowUpDown': /^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,
- '\\bond{(...)}': function bond(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\bond{", "", "", "}");
- },
- '->': /^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,
- 'CMT': /^[CMT](?=\[)/,
- '[(...)]': function _(input) {
- return mhchemParser.patterns.findObserveGroups(input, "[", "", "", "]");
- },
- '1st-level escape': /^(&|\\\\|\\hline)\s*/,
- '\\,': /^(?:\\[,\ ;:])/,
- // \\x - but output no space before
- '\\x{}{}': function x(input) {
- return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
- },
- '\\x{}': function x(input) {
- return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", "");
- },
- '\\ca': /^\\ca(?:\s+|(?![a-zA-Z]))/,
- '\\x': /^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,
- 'orbital': /^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,
- // only those with numbers in front, because the others will be formatted correctly anyway
- 'others': /^[\/~|]/,
- '\\frac{(...)}': function frac(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\frac{", "", "", "}", "{", "", "", "}");
- },
- '\\overset{(...)}': function overset(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\overset{", "", "", "}", "{", "", "", "}");
- },
- "\\underset{(...)}": function underset(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\underset{", "", "", "}", "{", "", "", "}");
- },
- "\\underbrace{(...)}": function underbrace(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\underbrace{", "", "", "}_", "{", "", "", "}");
- },
- '\\color{(...)}0': function color0(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}");
- },
- '\\color{(...)}{(...)}1': function color1(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}", "{", "", "", "}");
- },
- '\\color(...){(...)}2': function color2(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\color", "\\", "", /^(?=\{)/, "{", "", "", "}");
- },
- '\\ce{(...)}': function ce(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\ce{", "", "", "}");
- },
- 'oxidation$': /^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,
- 'd-oxidation$': /^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,
- // 0 could be oxidation or charge
- 'roman numeral': /^[IVX]+/,
- '1/2$': /^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,
- 'amount': function amount(input) {
- var match; // e.g. 2, 0.5, 1/2, -2, n/2, +; $a$ could be added later in parsing
-
- match = input.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/);
-
- if (match) {
- return {
- match_: match[0],
- remainder: input.substr(match[0].length)
- };
- }
-
- var a = mhchemParser.patterns.findObserveGroups(input, "", "$", "$", "");
-
- if (a) {
- // e.g. $2n-1$, $-$
- match = a.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/);
-
- if (match) {
- return {
- match_: match[0],
- remainder: input.substr(match[0].length)
- };
- }
- }
-
- return null;
- },
- 'amount2': function amount2(input) {
- return this['amount'](input);
- },
- '(KV letters),': /^(?:[A-Z][a-z]{0,2}|i)(?=,)/,
- 'formula$': function formula$(input) {
- if (input.match(/^\([a-z]+\)$/)) {
- return null;
- } // state of aggregation = no formula
-
-
- var match = input.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);
-
- if (match) {
- return {
- match_: match[0],
- remainder: input.substr(match[0].length)
- };
- }
-
- return null;
- },
- 'uprightEntities': /^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,
- '/': /^\s*(\/)\s*/,
- '//': /^\s*(\/\/)\s*/,
- '*': /^\s*[*.]\s*/
- },
- findObserveGroups: function findObserveGroups(input, begExcl, begIncl, endIncl, endExcl, beg2Excl, beg2Incl, end2Incl, end2Excl, combine) {
- /** @type {{(input: string, pattern: string | RegExp): string | string[] | null;}} */
- var _match = function _match(input, pattern) {
- if (typeof pattern === "string") {
- if (input.indexOf(pattern) !== 0) {
- return null;
- }
-
- return pattern;
- } else {
- var match = input.match(pattern);
-
- if (!match) {
- return null;
- }
-
- return match[0];
- }
- };
- /** @type {{(input: string, i: number, endChars: string | RegExp): {endMatchBegin: number, endMatchEnd: number} | null;}} */
-
-
- var _findObserveGroups = function _findObserveGroups(input, i, endChars) {
- var braces = 0;
-
- while (i < input.length) {
- var a = input.charAt(i);
-
- var match = _match(input.substr(i), endChars);
-
- if (match !== null && braces === 0) {
- return {
- endMatchBegin: i,
- endMatchEnd: i + match.length
- };
- } else if (a === "{") {
- braces++;
- } else if (a === "}") {
- if (braces === 0) {
- throw ["ExtraCloseMissingOpen", "Extra close brace or missing open brace"];
- } else {
- braces--;
- }
- }
-
- i++;
- }
-
- if (braces > 0) {
- return null;
- }
-
- return null;
- };
-
- var match = _match(input, begExcl);
-
- if (match === null) {
- return null;
- }
-
- input = input.substr(match.length);
- match = _match(input, begIncl);
-
- if (match === null) {
- return null;
- }
-
- var e = _findObserveGroups(input, match.length, endIncl || endExcl);
-
- if (e === null) {
- return null;
- }
-
- var match1 = input.substring(0, endIncl ? e.endMatchEnd : e.endMatchBegin);
-
- if (!(beg2Excl || beg2Incl)) {
- return {
- match_: match1,
- remainder: input.substr(e.endMatchEnd)
- };
- } else {
- var group2 = this.findObserveGroups(input.substr(e.endMatchEnd), beg2Excl, beg2Incl, end2Incl, end2Excl);
-
- if (group2 === null) {
- return null;
- }
- /** @type {string[]} */
-
-
- var matchRet = [match1, group2.match_];
- return {
- match_: combine ? matchRet.join("") : matchRet,
- remainder: group2.remainder
- };
- }
- },
- //
- // Matching function
- // e.g. match("a", input) will look for the regexp called "a" and see if it matches
- // returns null or {match_:"a", remainder:"bc"}
- //
- match_: function match_(m, input) {
- var pattern = mhchemParser.patterns.patterns[m];
-
- if (pattern === undefined) {
- throw ["MhchemBugP", "mhchem bug P. Please report. (" + m + ")"]; // Trying to use non-existing pattern
- } else if (typeof pattern === "function") {
- return mhchemParser.patterns.patterns[m](input); // cannot use cached var pattern here, because some pattern functions need this===mhchemParser
- } else {
- // RegExp
- var match = input.match(pattern);
-
- if (match) {
- var mm;
-
- if (match[2]) {
- mm = [match[1], match[2]];
- } else if (match[1]) {
- mm = match[1];
- } else {
- mm = match[0];
- }
-
- return {
- match_: mm,
- remainder: input.substr(match[0].length)
- };
- }
-
- return null;
- }
- }
- },
- //
- // Generic state machine actions
- //
- actions: {
- 'a=': function a(buffer, m) {
- buffer.a = (buffer.a || "") + m;
- },
- 'b=': function b(buffer, m) {
- buffer.b = (buffer.b || "") + m;
- },
- 'p=': function p(buffer, m) {
- buffer.p = (buffer.p || "") + m;
- },
- 'o=': function o(buffer, m) {
- buffer.o = (buffer.o || "") + m;
- },
- 'q=': function q(buffer, m) {
- buffer.q = (buffer.q || "") + m;
- },
- 'd=': function d(buffer, m) {
- buffer.d = (buffer.d || "") + m;
- },
- 'rm=': function rm(buffer, m) {
- buffer.rm = (buffer.rm || "") + m;
- },
- 'text=': function text(buffer, m) {
- buffer.text_ = (buffer.text_ || "") + m;
- },
- 'insert': function insert(buffer, m, a) {
- return {
- type_: a
- };
- },
- 'insert+p1': function insertP1(buffer, m, a) {
- return {
- type_: a,
- p1: m
- };
- },
- 'insert+p1+p2': function insertP1P2(buffer, m, a) {
- return {
- type_: a,
- p1: m[0],
- p2: m[1]
- };
- },
- 'copy': function copy(buffer, m) {
- return m;
- },
- 'rm': function rm(buffer, m) {
- return {
- type_: 'rm',
- p1: m || ""
- };
- },
- 'text': function text(buffer, m) {
- return mhchemParser.go(m, 'text');
- },
- '{text}': function text(buffer, m) {
- var ret = ["{"];
- mhchemParser.concatArray(ret, mhchemParser.go(m, 'text'));
- ret.push("}");
- return ret;
- },
- 'tex-math': function texMath(buffer, m) {
- return mhchemParser.go(m, 'tex-math');
- },
- 'tex-math tight': function texMathTight(buffer, m) {
- return mhchemParser.go(m, 'tex-math tight');
- },
- 'bond': function bond(buffer, m, k) {
- return {
- type_: 'bond',
- kind_: k || m
- };
- },
- 'color0-output': function color0Output(buffer, m) {
- return {
- type_: 'color0',
- color: m[0]
- };
- },
- 'ce': function ce(buffer, m) {
- return mhchemParser.go(m);
- },
- '1/2': function _(buffer, m) {
- /** @type {ParserOutput[]} */
- var ret = [];
-
- if (m.match(/^[+\-]/)) {
- ret.push(m.substr(0, 1));
- m = m.substr(1);
- }
-
- var n = m.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);
- n[1] = n[1].replace(/\$/g, "");
- ret.push({
- type_: 'frac',
- p1: n[1],
- p2: n[2]
- });
-
- if (n[3]) {
- n[3] = n[3].replace(/\$/g, "");
- ret.push({
- type_: 'tex-math',
- p1: n[3]
- });
- }
-
- return ret;
- },
- '9,9': function _(buffer, m) {
- return mhchemParser.go(m, '9,9');
- }
- },
- //
- // createTransitions
- // convert { 'letter': { 'state': { action_: 'output' } } } to { 'state' => [ { pattern: 'letter', task: { action_: [{type_: 'output'}] } } ] }
- // with expansion of 'a|b' to 'a' and 'b' (at 2 places)
- //
- createTransitions: function createTransitions(o) {
- var pattern, state;
- /** @type {string[]} */
-
- var stateArray;
- var i; //
- // 1. Collect all states
- //
-
- /** @type {Transitions} */
-
- var transitions = {};
-
- for (pattern in o) {
- for (state in o[pattern]) {
- stateArray = state.split("|");
- o[pattern][state].stateArray = stateArray;
-
- for (i = 0; i < stateArray.length; i++) {
- transitions[stateArray[i]] = [];
- }
- }
- } //
- // 2. Fill states
- //
-
-
- for (pattern in o) {
- for (state in o[pattern]) {
- stateArray = o[pattern][state].stateArray || [];
-
- for (i = 0; i < stateArray.length; i++) {
- //
- // 2a. Normalize actions into array: 'text=' ==> [{type_:'text='}]
- // (Note to myself: Resolving the function here would be problematic. It would need .bind (for *this*) and currying (for *option*).)
- //
-
- /** @type {any} */
- var p = o[pattern][state];
-
- if (p.action_) {
- p.action_ = [].concat(p.action_);
-
- for (var k = 0; k < p.action_.length; k++) {
- if (typeof p.action_[k] === "string") {
- p.action_[k] = {
- type_: p.action_[k]
- };
- }
- }
- } else {
- p.action_ = [];
- } //
- // 2.b Multi-insert
- //
-
-
- var patternArray = pattern.split("|");
-
- for (var j = 0; j < patternArray.length; j++) {
- if (stateArray[i] === '*') {
- // insert into all
- for (var t in transitions) {
- transitions[t].push({
- pattern: patternArray[j],
- task: p
- });
- }
- } else {
- transitions[stateArray[i]].push({
- pattern: patternArray[j],
- task: p
- });
- }
- }
- }
- }
- }
-
- return transitions;
- },
- stateMachines: {}
-}; //
-// Definition of state machines
-//
-
-mhchemParser.stateMachines = {
- //
- // \ce state machines
- //
- //#region ce
- 'ce': {
- // main parser
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {
- action_: 'output'
- }
- },
- 'else': {
- '0|1|2': {
- action_: 'beginsWithBond=false',
- revisit: true,
- toContinue: true
- }
- },
- 'oxidation$': {
- '0': {
- action_: 'oxidation-output'
- }
- },
- 'CMT': {
- 'r': {
- action_: 'rdt=',
- nextState: 'rt'
- },
- 'rd': {
- action_: 'rqt=',
- nextState: 'rdt'
- }
- },
- 'arrowUpDown': {
- '0|1|2|as': {
- action_: ['sb=false', 'output', 'operator'],
- nextState: '1'
- }
- },
- 'uprightEntities': {
- '0|1|2': {
- action_: ['o=', 'output'],
- nextState: '1'
- }
- },
- 'orbital': {
- '0|1|2|3': {
- action_: 'o=',
- nextState: 'o'
- }
- },
- '->': {
- '0|1|2|3': {
- action_: 'r=',
- nextState: 'r'
- },
- 'a|as': {
- action_: ['output', 'r='],
- nextState: 'r'
- },
- '*': {
- action_: ['output', 'r='],
- nextState: 'r'
- }
- },
- '+': {
- 'o': {
- action_: 'd= kv',
- nextState: 'd'
- },
- 'd|D': {
- action_: 'd=',
- nextState: 'd'
- },
- 'q': {
- action_: 'd=',
- nextState: 'qd'
- },
- 'qd|qD': {
- action_: 'd=',
- nextState: 'qd'
- },
- 'dq': {
- action_: ['output', 'd='],
- nextState: 'd'
- },
- '3': {
- action_: ['sb=false', 'output', 'operator'],
- nextState: '0'
- }
- },
- 'amount': {
- '0|2': {
- action_: 'a=',
- nextState: 'a'
- }
- },
- 'pm-operator': {
- '0|1|2|a|as': {
- action_: ['sb=false', 'output', {
- type_: 'operator',
- option: '\\pm'
- }],
- nextState: '0'
- }
- },
- 'operator': {
- '0|1|2|a|as': {
- action_: ['sb=false', 'output', 'operator'],
- nextState: '0'
- }
- },
- '-$': {
- 'o|q': {
- action_: ['charge or bond', 'output'],
- nextState: 'qd'
- },
- 'd': {
- action_: 'd=',
- nextState: 'd'
- },
- 'D': {
- action_: ['output', {
- type_: 'bond',
- option: "-"
- }],
- nextState: '3'
- },
- 'q': {
- action_: 'd=',
- nextState: 'qd'
- },
- 'qd': {
- action_: 'd=',
- nextState: 'qd'
- },
- 'qD|dq': {
- action_: ['output', {
- type_: 'bond',
- option: "-"
- }],
- nextState: '3'
- }
- },
- '-9': {
- '3|o': {
- action_: ['output', {
- type_: 'insert',
- option: 'hyphen'
- }],
- nextState: '3'
- }
- },
- '- orbital overlap': {
- 'o': {
- action_: ['output', {
- type_: 'insert',
- option: 'hyphen'
- }],
- nextState: '2'
- },
- 'd': {
- action_: ['output', {
- type_: 'insert',
- option: 'hyphen'
- }],
- nextState: '2'
- }
- },
- '-': {
- '0|1|2': {
- action_: [{
- type_: 'output',
- option: 1
- }, 'beginsWithBond=true', {
- type_: 'bond',
- option: "-"
- }],
- nextState: '3'
- },
- '3': {
- action_: {
- type_: 'bond',
- option: "-"
- }
- },
- 'a': {
- action_: ['output', {
- type_: 'insert',
- option: 'hyphen'
- }],
- nextState: '2'
- },
- 'as': {
- action_: [{
- type_: 'output',
- option: 2
- }, {
- type_: 'bond',
- option: "-"
- }],
- nextState: '3'
- },
- 'b': {
- action_: 'b='
- },
- 'o': {
- action_: {
- type_: '- after o/d',
- option: false
- },
- nextState: '2'
- },
- 'q': {
- action_: {
- type_: '- after o/d',
- option: false
- },
- nextState: '2'
- },
- 'd|qd|dq': {
- action_: {
- type_: '- after o/d',
- option: true
- },
- nextState: '2'
- },
- 'D|qD|p': {
- action_: ['output', {
- type_: 'bond',
- option: "-"
- }],
- nextState: '3'
- }
- },
- 'amount2': {
- '1|3': {
- action_: 'a=',
- nextState: 'a'
- }
- },
- 'letters': {
- '0|1|2|3|a|as|b|p|bp|o': {
- action_: 'o=',
- nextState: 'o'
- },
- 'q|dq': {
- action_: ['output', 'o='],
- nextState: 'o'
- },
- 'd|D|qd|qD': {
- action_: 'o after d',
- nextState: 'o'
- }
- },
- 'digits': {
- 'o': {
- action_: 'q=',
- nextState: 'q'
- },
- 'd|D': {
- action_: 'q=',
- nextState: 'dq'
- },
- 'q': {
- action_: ['output', 'o='],
- nextState: 'o'
- },
- 'a': {
- action_: 'o=',
- nextState: 'o'
- }
- },
- 'space A': {
- 'b|p|bp': {}
- },
- 'space': {
- 'a': {
- nextState: 'as'
- },
- '0': {
- action_: 'sb=false'
- },
- '1|2': {
- action_: 'sb=true'
- },
- 'r|rt|rd|rdt|rdq': {
- action_: 'output',
- nextState: '0'
- },
- '*': {
- action_: ['output', 'sb=true'],
- nextState: '1'
- }
- },
- '1st-level escape': {
- '1|2': {
- action_: ['output', {
- type_: 'insert+p1',
- option: '1st-level escape'
- }]
- },
- '*': {
- action_: ['output', {
- type_: 'insert+p1',
- option: '1st-level escape'
- }],
- nextState: '0'
- }
- },
- '[(...)]': {
- 'r|rt': {
- action_: 'rd=',
- nextState: 'rd'
- },
- 'rd|rdt': {
- action_: 'rq=',
- nextState: 'rdq'
- }
- },
- '...': {
- 'o|d|D|dq|qd|qD': {
- action_: ['output', {
- type_: 'bond',
- option: "..."
- }],
- nextState: '3'
- },
- '*': {
- action_: [{
- type_: 'output',
- option: 1
- }, {
- type_: 'insert',
- option: 'ellipsis'
- }],
- nextState: '1'
- }
- },
- '. |* ': {
- '*': {
- action_: ['output', {
- type_: 'insert',
- option: 'addition compound'
- }],
- nextState: '1'
- }
- },
- 'state of aggregation $': {
- '*': {
- action_: ['output', 'state of aggregation'],
- nextState: '1'
- }
- },
- '{[(': {
- 'a|as|o': {
- action_: ['o=', 'output', 'parenthesisLevel++'],
- nextState: '2'
- },
- '0|1|2|3': {
- action_: ['o=', 'output', 'parenthesisLevel++'],
- nextState: '2'
- },
- '*': {
- action_: ['output', 'o=', 'output', 'parenthesisLevel++'],
- nextState: '2'
- }
- },
- ')]}': {
- '0|1|2|3|b|p|bp|o': {
- action_: ['o=', 'parenthesisLevel--'],
- nextState: 'o'
- },
- 'a|as|d|D|q|qd|qD|dq': {
- action_: ['output', 'o=', 'parenthesisLevel--'],
- nextState: 'o'
- }
- },
- ', ': {
- '*': {
- action_: ['output', 'comma'],
- nextState: '0'
- }
- },
- '^_': {
- // ^ and _ without a sensible argument
- '*': {}
- },
- '^{(...)}|^($...$)': {
- '0|1|2|as': {
- action_: 'b=',
- nextState: 'b'
- },
- 'p': {
- action_: 'b=',
- nextState: 'bp'
- },
- '3|o': {
- action_: 'd= kv',
- nextState: 'D'
- },
- 'q': {
- action_: 'd=',
- nextState: 'qD'
- },
- 'd|D|qd|qD|dq': {
- action_: ['output', 'd='],
- nextState: 'D'
- }
- },
- '^a|^\\x{}{}|^\\x{}|^\\x|\'': {
- '0|1|2|as': {
- action_: 'b=',
- nextState: 'b'
- },
- 'p': {
- action_: 'b=',
- nextState: 'bp'
- },
- '3|o': {
- action_: 'd= kv',
- nextState: 'd'
- },
- 'q': {
- action_: 'd=',
- nextState: 'qd'
- },
- 'd|qd|D|qD': {
- action_: 'd='
- },
- 'dq': {
- action_: ['output', 'd='],
- nextState: 'd'
- }
- },
- '_{(state of aggregation)}$': {
- 'd|D|q|qd|qD|dq': {
- action_: ['output', 'q='],
- nextState: 'q'
- }
- },
- '_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x': {
- '0|1|2|as': {
- action_: 'p=',
- nextState: 'p'
- },
- 'b': {
- action_: 'p=',
- nextState: 'bp'
- },
- '3|o': {
- action_: 'q=',
- nextState: 'q'
- },
- 'd|D': {
- action_: 'q=',
- nextState: 'dq'
- },
- 'q|qd|qD|dq': {
- action_: ['output', 'q='],
- nextState: 'q'
- }
- },
- '=<>': {
- '0|1|2|3|a|as|o|q|d|D|qd|qD|dq': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'bond'],
- nextState: '3'
- }
- },
- '#': {
- '0|1|2|3|a|as|o': {
- action_: [{
- type_: 'output',
- option: 2
- }, {
- type_: 'bond',
- option: "#"
- }],
- nextState: '3'
- }
- },
- '{}': {
- '*': {
- action_: {
- type_: 'output',
- option: 1
- },
- nextState: '1'
- }
- },
- '{...}': {
- '0|1|2|3|a|as|b|p|bp': {
- action_: 'o=',
- nextState: 'o'
- },
- 'o|d|D|q|qd|qD|dq': {
- action_: ['output', 'o='],
- nextState: 'o'
- }
- },
- '$...$': {
- 'a': {
- action_: 'a='
- },
- // 2$n$
- '0|1|2|3|as|b|p|bp|o': {
- action_: 'o=',
- nextState: 'o'
- },
- // not 'amount'
- 'as|o': {
- action_: 'o='
- },
- 'q|d|D|qd|qD|dq': {
- action_: ['output', 'o='],
- nextState: 'o'
- }
- },
- '\\bond{(...)}': {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'bond'],
- nextState: "3"
- }
- },
- '\\frac{(...)}': {
- '*': {
- action_: [{
- type_: 'output',
- option: 1
- }, 'frac-output'],
- nextState: '3'
- }
- },
- '\\overset{(...)}': {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'overset-output'],
- nextState: '3'
- }
- },
- "\\underset{(...)}": {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'underset-output'],
- nextState: '3'
- }
- },
- "\\underbrace{(...)}": {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'underbrace-output'],
- nextState: '3'
- }
- },
- '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'color-output'],
- nextState: '3'
- }
- },
- '\\color{(...)}0': {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'color0-output']
- }
- },
- '\\ce{(...)}': {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'ce'],
- nextState: '3'
- }
- },
- '\\,': {
- '*': {
- action_: [{
- type_: 'output',
- option: 1
- }, 'copy'],
- nextState: '1'
- }
- },
- '\\x{}{}|\\x{}|\\x': {
- '0|1|2|3|a|as|b|p|bp|o|c0': {
- action_: ['o=', 'output'],
- nextState: '3'
- },
- '*': {
- action_: ['output', 'o=', 'output'],
- nextState: '3'
- }
- },
- 'others': {
- '*': {
- action_: [{
- type_: 'output',
- option: 1
- }, 'copy'],
- nextState: '3'
- }
- },
- 'else2': {
- 'a': {
- action_: 'a to o',
- nextState: 'o',
- revisit: true
- },
- 'as': {
- action_: ['output', 'sb=true'],
- nextState: '1',
- revisit: true
- },
- 'r|rt|rd|rdt|rdq': {
- action_: ['output'],
- nextState: '0',
- revisit: true
- },
- '*': {
- action_: ['output', 'copy'],
- nextState: '3'
- }
- }
- }),
- actions: {
- 'o after d': function oAfterD(buffer, m) {
- var ret;
-
- if ((buffer.d || "").match(/^[0-9]+$/)) {
- var tmp = buffer.d;
- buffer.d = undefined;
- ret = this['output'](buffer);
- buffer.b = tmp;
- } else {
- ret = this['output'](buffer);
- }
-
- mhchemParser.actions['o='](buffer, m);
- return ret;
- },
- 'd= kv': function dKv(buffer, m) {
- buffer.d = m;
- buffer.dType = 'kv';
- },
- 'charge or bond': function chargeOrBond(buffer, m) {
- if (buffer['beginsWithBond']) {
- /** @type {ParserOutput[]} */
- var ret = [];
- mhchemParser.concatArray(ret, this['output'](buffer));
- mhchemParser.concatArray(ret, mhchemParser.actions['bond'](buffer, m, "-"));
- return ret;
- } else {
- buffer.d = m;
- }
- },
- '- after o/d': function afterOD(buffer, m, isAfterD) {
- var c1 = mhchemParser.patterns.match_('orbital', buffer.o || "");
- var c2 = mhchemParser.patterns.match_('one lowercase greek letter $', buffer.o || "");
- var c3 = mhchemParser.patterns.match_('one lowercase latin letter $', buffer.o || "");
- var c4 = mhchemParser.patterns.match_('$one lowercase latin letter$ $', buffer.o || "");
- var hyphenFollows = m === "-" && (c1 && c1.remainder === "" || c2 || c3 || c4);
-
- if (hyphenFollows && !buffer.a && !buffer.b && !buffer.p && !buffer.d && !buffer.q && !c1 && c3) {
- buffer.o = '$' + buffer.o + '$';
- }
- /** @type {ParserOutput[]} */
-
-
- var ret = [];
-
- if (hyphenFollows) {
- mhchemParser.concatArray(ret, this['output'](buffer));
- ret.push({
- type_: 'hyphen'
- });
- } else {
- c1 = mhchemParser.patterns.match_('digits', buffer.d || "");
-
- if (isAfterD && c1 && c1.remainder === '') {
- mhchemParser.concatArray(ret, mhchemParser.actions['d='](buffer, m));
- mhchemParser.concatArray(ret, this['output'](buffer));
- } else {
- mhchemParser.concatArray(ret, this['output'](buffer));
- mhchemParser.concatArray(ret, mhchemParser.actions['bond'](buffer, m, "-"));
- }
- }
-
- return ret;
- },
- 'a to o': function aToO(buffer) {
- buffer.o = buffer.a;
- buffer.a = undefined;
- },
- 'sb=true': function sbTrue(buffer) {
- buffer.sb = true;
- },
- 'sb=false': function sbFalse(buffer) {
- buffer.sb = false;
- },
- 'beginsWithBond=true': function beginsWithBondTrue(buffer) {
- buffer['beginsWithBond'] = true;
- },
- 'beginsWithBond=false': function beginsWithBondFalse(buffer) {
- buffer['beginsWithBond'] = false;
- },
- 'parenthesisLevel++': function parenthesisLevel(buffer) {
- buffer['parenthesisLevel']++;
- },
- 'parenthesisLevel--': function parenthesisLevel(buffer) {
- buffer['parenthesisLevel']--;
- },
- 'state of aggregation': function stateOfAggregation(buffer, m) {
- return {
- type_: 'state of aggregation',
- p1: mhchemParser.go(m, 'o')
- };
- },
- 'comma': function comma(buffer, m) {
- var a = m.replace(/\s*$/, '');
- var withSpace = a !== m;
-
- if (withSpace && buffer['parenthesisLevel'] === 0) {
- return {
- type_: 'comma enumeration L',
- p1: a
- };
- } else {
- return {
- type_: 'comma enumeration M',
- p1: a
- };
- }
- },
- 'output': function output(buffer, m, entityFollows) {
- // entityFollows:
- // undefined = if we have nothing else to output, also ignore the just read space (buffer.sb)
- // 1 = an entity follows, never omit the space if there was one just read before (can only apply to state 1)
- // 2 = 1 + the entity can have an amount, so output a\, instead of converting it to o (can only apply to states a|as)
-
- /** @type {ParserOutput | ParserOutput[]} */
- var ret;
-
- if (!buffer.r) {
- ret = [];
-
- if (!buffer.a && !buffer.b && !buffer.p && !buffer.o && !buffer.q && !buffer.d && !entityFollows) {//ret = [];
- } else {
- if (buffer.sb) {
- ret.push({
- type_: 'entitySkip'
- });
- }
-
- if (!buffer.o && !buffer.q && !buffer.d && !buffer.b && !buffer.p && entityFollows !== 2) {
- buffer.o = buffer.a;
- buffer.a = undefined;
- } else if (!buffer.o && !buffer.q && !buffer.d && (buffer.b || buffer.p)) {
- buffer.o = buffer.a;
- buffer.d = buffer.b;
- buffer.q = buffer.p;
- buffer.a = buffer.b = buffer.p = undefined;
- } else {
- if (buffer.o && buffer.dType === 'kv' && mhchemParser.patterns.match_('d-oxidation$', buffer.d || "")) {
- buffer.dType = 'oxidation';
- } else if (buffer.o && buffer.dType === 'kv' && !buffer.q) {
- buffer.dType = undefined;
- }
- }
-
- ret.push({
- type_: 'chemfive',
- a: mhchemParser.go(buffer.a, 'a'),
- b: mhchemParser.go(buffer.b, 'bd'),
- p: mhchemParser.go(buffer.p, 'pq'),
- o: mhchemParser.go(buffer.o, 'o'),
- q: mhchemParser.go(buffer.q, 'pq'),
- d: mhchemParser.go(buffer.d, buffer.dType === 'oxidation' ? 'oxidation' : 'bd'),
- dType: buffer.dType
- });
- }
- } else {
- // r
-
- /** @type {ParserOutput[]} */
- var rd;
-
- if (buffer.rdt === 'M') {
- rd = mhchemParser.go(buffer.rd, 'tex-math');
- } else if (buffer.rdt === 'T') {
- rd = [{
- type_: 'text',
- p1: buffer.rd || ""
- }];
- } else {
- rd = mhchemParser.go(buffer.rd);
- }
- /** @type {ParserOutput[]} */
-
-
- var rq;
-
- if (buffer.rqt === 'M') {
- rq = mhchemParser.go(buffer.rq, 'tex-math');
- } else if (buffer.rqt === 'T') {
- rq = [{
- type_: 'text',
- p1: buffer.rq || ""
- }];
- } else {
- rq = mhchemParser.go(buffer.rq);
- }
-
- ret = {
- type_: 'arrow',
- r: buffer.r,
- rd: rd,
- rq: rq
- };
- }
-
- for (var p in buffer) {
- if (p !== 'parenthesisLevel' && p !== 'beginsWithBond') {
- delete buffer[p];
- }
- }
-
- return ret;
- },
- 'oxidation-output': function oxidationOutput(buffer, m) {
- var ret = ["{"];
- mhchemParser.concatArray(ret, mhchemParser.go(m, 'oxidation'));
- ret.push("}");
- return ret;
- },
- 'frac-output': function fracOutput(buffer, m) {
- return {
- type_: 'frac-ce',
- p1: mhchemParser.go(m[0]),
- p2: mhchemParser.go(m[1])
- };
- },
- 'overset-output': function oversetOutput(buffer, m) {
- return {
- type_: 'overset',
- p1: mhchemParser.go(m[0]),
- p2: mhchemParser.go(m[1])
- };
- },
- 'underset-output': function undersetOutput(buffer, m) {
- return {
- type_: 'underset',
- p1: mhchemParser.go(m[0]),
- p2: mhchemParser.go(m[1])
- };
- },
- 'underbrace-output': function underbraceOutput(buffer, m) {
- return {
- type_: 'underbrace',
- p1: mhchemParser.go(m[0]),
- p2: mhchemParser.go(m[1])
- };
- },
- 'color-output': function colorOutput(buffer, m) {
- return {
- type_: 'color',
- color1: m[0],
- color2: mhchemParser.go(m[1])
- };
- },
- 'r=': function r(buffer, m) {
- buffer.r = m;
- },
- 'rdt=': function rdt(buffer, m) {
- buffer.rdt = m;
- },
- 'rd=': function rd(buffer, m) {
- buffer.rd = m;
- },
- 'rqt=': function rqt(buffer, m) {
- buffer.rqt = m;
- },
- 'rq=': function rq(buffer, m) {
- buffer.rq = m;
- },
- 'operator': function operator(buffer, m, p1) {
- return {
- type_: 'operator',
- kind_: p1 || m
- };
- }
- }
- },
- 'a': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {}
- },
- '1/2$': {
- '0': {
- action_: '1/2'
- }
- },
- 'else': {
- '0': {
- nextState: '1',
- revisit: true
- }
- },
- '$(...)$': {
- '*': {
- action_: 'tex-math tight',
- nextState: '1'
- }
- },
- ',': {
- '*': {
- action_: {
- type_: 'insert',
- option: 'commaDecimal'
- }
- }
- },
- 'else2': {
- '*': {
- action_: 'copy'
- }
- }
- }),
- actions: {}
- },
- 'o': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {}
- },
- '1/2$': {
- '0': {
- action_: '1/2'
- }
- },
- 'else': {
- '0': {
- nextState: '1',
- revisit: true
- }
- },
- 'letters': {
- '*': {
- action_: 'rm'
- }
- },
- '\\ca': {
- '*': {
- action_: {
- type_: 'insert',
- option: 'circa'
- }
- }
- },
- '\\x{}{}|\\x{}|\\x': {
- '*': {
- action_: 'copy'
- }
- },
- '${(...)}$|$(...)$': {
- '*': {
- action_: 'tex-math'
- }
- },
- '{(...)}': {
- '*': {
- action_: '{text}'
- }
- },
- 'else2': {
- '*': {
- action_: 'copy'
- }
- }
- }),
- actions: {}
- },
- 'text': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {
- action_: 'output'
- }
- },
- '{...}': {
- '*': {
- action_: 'text='
- }
- },
- '${(...)}$|$(...)$': {
- '*': {
- action_: 'tex-math'
- }
- },
- '\\greek': {
- '*': {
- action_: ['output', 'rm']
- }
- },
- '\\,|\\x{}{}|\\x{}|\\x': {
- '*': {
- action_: ['output', 'copy']
- }
- },
- 'else': {
- '*': {
- action_: 'text='
- }
- }
- }),
- actions: {
- 'output': function output(buffer) {
- if (buffer.text_) {
- /** @type {ParserOutput} */
- var ret = {
- type_: 'text',
- p1: buffer.text_
- };
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- }
- }
- }
- },
- 'pq': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {}
- },
- 'state of aggregation $': {
- '*': {
- action_: 'state of aggregation'
- }
- },
- 'i$': {
- '0': {
- nextState: '!f',
- revisit: true
- }
- },
- '(KV letters),': {
- '0': {
- action_: 'rm',
- nextState: '0'
- }
- },
- 'formula$': {
- '0': {
- nextState: 'f',
- revisit: true
- }
- },
- '1/2$': {
- '0': {
- action_: '1/2'
- }
- },
- 'else': {
- '0': {
- nextState: '!f',
- revisit: true
- }
- },
- '${(...)}$|$(...)$': {
- '*': {
- action_: 'tex-math'
- }
- },
- '{(...)}': {
- '*': {
- action_: 'text'
- }
- },
- 'a-z': {
- 'f': {
- action_: 'tex-math'
- }
- },
- 'letters': {
- '*': {
- action_: 'rm'
- }
- },
- '-9.,9': {
- '*': {
- action_: '9,9'
- }
- },
- ',': {
- '*': {
- action_: {
- type_: 'insert+p1',
- option: 'comma enumeration S'
- }
- }
- },
- '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
- '*': {
- action_: 'color-output'
- }
- },
- '\\color{(...)}0': {
- '*': {
- action_: 'color0-output'
- }
- },
- '\\ce{(...)}': {
- '*': {
- action_: 'ce'
- }
- },
- '\\,|\\x{}{}|\\x{}|\\x': {
- '*': {
- action_: 'copy'
- }
- },
- 'else2': {
- '*': {
- action_: 'copy'
- }
- }
- }),
- actions: {
- 'state of aggregation': function stateOfAggregation(buffer, m) {
- return {
- type_: 'state of aggregation subscript',
- p1: mhchemParser.go(m, 'o')
- };
- },
- 'color-output': function colorOutput(buffer, m) {
- return {
- type_: 'color',
- color1: m[0],
- color2: mhchemParser.go(m[1], 'pq')
- };
- }
- }
- },
- 'bd': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {}
- },
- 'x$': {
- '0': {
- nextState: '!f',
- revisit: true
- }
- },
- 'formula$': {
- '0': {
- nextState: 'f',
- revisit: true
- }
- },
- 'else': {
- '0': {
- nextState: '!f',
- revisit: true
- }
- },
- '-9.,9 no missing 0': {
- '*': {
- action_: '9,9'
- }
- },
- '.': {
- '*': {
- action_: {
- type_: 'insert',
- option: 'electron dot'
- }
- }
- },
- 'a-z': {
- 'f': {
- action_: 'tex-math'
- }
- },
- 'x': {
- '*': {
- action_: {
- type_: 'insert',
- option: 'KV x'
- }
- }
- },
- 'letters': {
- '*': {
- action_: 'rm'
- }
- },
- '\'': {
- '*': {
- action_: {
- type_: 'insert',
- option: 'prime'
- }
- }
- },
- '${(...)}$|$(...)$': {
- '*': {
- action_: 'tex-math'
- }
- },
- '{(...)}': {
- '*': {
- action_: 'text'
- }
- },
- '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
- '*': {
- action_: 'color-output'
- }
- },
- '\\color{(...)}0': {
- '*': {
- action_: 'color0-output'
- }
- },
- '\\ce{(...)}': {
- '*': {
- action_: 'ce'
- }
- },
- '\\,|\\x{}{}|\\x{}|\\x': {
- '*': {
- action_: 'copy'
- }
- },
- 'else2': {
- '*': {
- action_: 'copy'
- }
- }
- }),
- actions: {
- 'color-output': function colorOutput(buffer, m) {
- return {
- type_: 'color',
- color1: m[0],
- color2: mhchemParser.go(m[1], 'bd')
- };
- }
- }
- },
- 'oxidation': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {}
- },
- 'roman numeral': {
- '*': {
- action_: 'roman-numeral'
- }
- },
- '${(...)}$|$(...)$': {
- '*': {
- action_: 'tex-math'
- }
- },
- 'else': {
- '*': {
- action_: 'copy'
- }
- }
- }),
- actions: {
- 'roman-numeral': function romanNumeral(buffer, m) {
- return {
- type_: 'roman numeral',
- p1: m || ""
- };
- }
- }
- },
- 'tex-math': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {
- action_: 'output'
- }
- },
- '\\ce{(...)}': {
- '*': {
- action_: ['output', 'ce']
- }
- },
- '{...}|\\,|\\x{}{}|\\x{}|\\x': {
- '*': {
- action_: 'o='
- }
- },
- 'else': {
- '*': {
- action_: 'o='
- }
- }
- }),
- actions: {
- 'output': function output(buffer) {
- if (buffer.o) {
- /** @type {ParserOutput} */
- var ret = {
- type_: 'tex-math',
- p1: buffer.o
- };
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- }
- }
- }
- },
- 'tex-math tight': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {
- action_: 'output'
- }
- },
- '\\ce{(...)}': {
- '*': {
- action_: ['output', 'ce']
- }
- },
- '{...}|\\,|\\x{}{}|\\x{}|\\x': {
- '*': {
- action_: 'o='
- }
- },
- '-|+': {
- '*': {
- action_: 'tight operator'
- }
- },
- 'else': {
- '*': {
- action_: 'o='
- }
- }
- }),
- actions: {
- 'tight operator': function tightOperator(buffer, m) {
- buffer.o = (buffer.o || "") + "{" + m + "}";
- },
- 'output': function output(buffer) {
- if (buffer.o) {
- /** @type {ParserOutput} */
- var ret = {
- type_: 'tex-math',
- p1: buffer.o
- };
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- }
- }
- }
- },
- '9,9': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {}
- },
- ',': {
- '*': {
- action_: 'comma'
- }
- },
- 'else': {
- '*': {
- action_: 'copy'
- }
- }
- }),
- actions: {
- 'comma': function comma() {
- return {
- type_: 'commaDecimal'
- };
- }
- }
- },
- //#endregion
- //
- // \pu state machines
- //
- //#region pu
- 'pu': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {
- action_: 'output'
- }
- },
- 'space$': {
- '*': {
- action_: ['output', 'space']
- }
- },
- '{[(|)]}': {
- '0|a': {
- action_: 'copy'
- }
- },
- '(-)(9)^(-9)': {
- '0': {
- action_: 'number^',
- nextState: 'a'
- }
- },
- '(-)(9.,9)(e)(99)': {
- '0': {
- action_: 'enumber',
- nextState: 'a'
- }
- },
- 'space': {
- '0|a': {}
- },
- 'pm-operator': {
- '0|a': {
- action_: {
- type_: 'operator',
- option: '\\pm'
- },
- nextState: '0'
- }
- },
- 'operator': {
- '0|a': {
- action_: 'copy',
- nextState: '0'
- }
- },
- '//': {
- 'd': {
- action_: 'o=',
- nextState: '/'
- }
- },
- '/': {
- 'd': {
- action_: 'o=',
- nextState: '/'
- }
- },
- '{...}|else': {
- '0|d': {
- action_: 'd=',
- nextState: 'd'
- },
- 'a': {
- action_: ['space', 'd='],
- nextState: 'd'
- },
- '/|q': {
- action_: 'q=',
- nextState: 'q'
- }
- }
- }),
- actions: {
- 'enumber': function enumber(buffer, m) {
- /** @type {ParserOutput[]} */
- var ret = [];
-
- if (m[0] === "+-" || m[0] === "+/-") {
- ret.push("\\pm ");
- } else if (m[0]) {
- ret.push(m[0]);
- }
-
- if (m[1]) {
- mhchemParser.concatArray(ret, mhchemParser.go(m[1], 'pu-9,9'));
-
- if (m[2]) {
- if (m[2].match(/[,.]/)) {
- mhchemParser.concatArray(ret, mhchemParser.go(m[2], 'pu-9,9'));
- } else {
- ret.push(m[2]);
- }
- }
-
- m[3] = m[4] || m[3];
-
- if (m[3]) {
- m[3] = m[3].trim();
-
- if (m[3] === "e" || m[3].substr(0, 1) === "*") {
- ret.push({
- type_: 'cdot'
- });
- } else {
- ret.push({
- type_: 'times'
- });
- }
- }
- }
-
- if (m[3]) {
- ret.push("10^{" + m[5] + "}");
- }
-
- return ret;
- },
- 'number^': function number(buffer, m) {
- /** @type {ParserOutput[]} */
- var ret = [];
-
- if (m[0] === "+-" || m[0] === "+/-") {
- ret.push("\\pm ");
- } else if (m[0]) {
- ret.push(m[0]);
- }
-
- mhchemParser.concatArray(ret, mhchemParser.go(m[1], 'pu-9,9'));
- ret.push("^{" + m[2] + "}");
- return ret;
- },
- 'operator': function operator(buffer, m, p1) {
- return {
- type_: 'operator',
- kind_: p1 || m
- };
- },
- 'space': function space() {
- return {
- type_: 'pu-space-1'
- };
- },
- 'output': function output(buffer) {
- /** @type {ParserOutput | ParserOutput[]} */
- var ret;
- var md = mhchemParser.patterns.match_('{(...)}', buffer.d || "");
-
- if (md && md.remainder === '') {
- buffer.d = md.match_;
- }
-
- var mq = mhchemParser.patterns.match_('{(...)}', buffer.q || "");
-
- if (mq && mq.remainder === '') {
- buffer.q = mq.match_;
- }
-
- if (buffer.d) {
- buffer.d = buffer.d.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
- buffer.d = buffer.d.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
- }
-
- if (buffer.q) {
- // fraction
- buffer.q = buffer.q.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
- buffer.q = buffer.q.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
- var b5 = {
- d: mhchemParser.go(buffer.d, 'pu'),
- q: mhchemParser.go(buffer.q, 'pu')
- };
-
- if (buffer.o === '//') {
- ret = {
- type_: 'pu-frac',
- p1: b5.d,
- p2: b5.q
- };
- } else {
- ret = b5.d;
-
- if (b5.d.length > 1 || b5.q.length > 1) {
- ret.push({
- type_: ' / '
- });
- } else {
- ret.push({
- type_: '/'
- });
- }
-
- mhchemParser.concatArray(ret, b5.q);
- }
- } else {
- // no fraction
- ret = mhchemParser.go(buffer.d, 'pu-2');
- }
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- }
- }
- },
- 'pu-2': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {
- action_: 'output'
- }
- },
- '*': {
- '*': {
- action_: ['output', 'cdot'],
- nextState: '0'
- }
- },
- '\\x': {
- '*': {
- action_: 'rm='
- }
- },
- 'space': {
- '*': {
- action_: ['output', 'space'],
- nextState: '0'
- }
- },
- '^{(...)}|^(-1)': {
- '1': {
- action_: '^(-1)'
- }
- },
- '-9.,9': {
- '0': {
- action_: 'rm=',
- nextState: '0'
- },
- '1': {
- action_: '^(-1)',
- nextState: '0'
- }
- },
- '{...}|else': {
- '*': {
- action_: 'rm=',
- nextState: '1'
- }
- }
- }),
- actions: {
- 'cdot': function cdot() {
- return {
- type_: 'tight cdot'
- };
- },
- '^(-1)': function _(buffer, m) {
- buffer.rm += "^{" + m + "}";
- },
- 'space': function space() {
- return {
- type_: 'pu-space-2'
- };
- },
- 'output': function output(buffer) {
- /** @type {ParserOutput | ParserOutput[]} */
- var ret = [];
-
- if (buffer.rm) {
- var mrm = mhchemParser.patterns.match_('{(...)}', buffer.rm || "");
-
- if (mrm && mrm.remainder === '') {
- ret = mhchemParser.go(mrm.match_, 'pu');
- } else {
- ret = {
- type_: 'rm',
- p1: buffer.rm
- };
- }
- }
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- }
- }
- },
- 'pu-9,9': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '0': {
- action_: 'output-0'
- },
- 'o': {
- action_: 'output-o'
- }
- },
- ',': {
- '0': {
- action_: ['output-0', 'comma'],
- nextState: 'o'
- }
- },
- '.': {
- '0': {
- action_: ['output-0', 'copy'],
- nextState: 'o'
- }
- },
- 'else': {
- '*': {
- action_: 'text='
- }
- }
- }),
- actions: {
- 'comma': function comma() {
- return {
- type_: 'commaDecimal'
- };
- },
- 'output-0': function output0(buffer) {
- /** @type {ParserOutput[]} */
- var ret = [];
- buffer.text_ = buffer.text_ || "";
-
- if (buffer.text_.length > 4) {
- var a = buffer.text_.length % 3;
-
- if (a === 0) {
- a = 3;
- }
-
- for (var i = buffer.text_.length - 3; i > 0; i -= 3) {
- ret.push(buffer.text_.substr(i, 3));
- ret.push({
- type_: '1000 separator'
- });
- }
-
- ret.push(buffer.text_.substr(0, a));
- ret.reverse();
- } else {
- ret.push(buffer.text_);
- }
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- },
- 'output-o': function outputO(buffer) {
- /** @type {ParserOutput[]} */
- var ret = [];
- buffer.text_ = buffer.text_ || "";
-
- if (buffer.text_.length > 4) {
- var a = buffer.text_.length - 3;
-
- for (var i = 0; i < a; i += 3) {
- ret.push(buffer.text_.substr(i, 3));
- ret.push({
- type_: '1000 separator'
- });
- }
-
- ret.push(buffer.text_.substr(i));
- } else {
- ret.push(buffer.text_);
- }
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- }
- }
- } //#endregion
-
-}; //
-// texify: Take MhchemParser output and convert it to TeX
-//
-
-/** @type {Texify} */
-
-var texify = {
- go: function go(input, isInner) {
- // (recursive, max 4 levels)
- if (!input) {
- return "";
- }
-
- var res = "";
- var cee = false;
-
- for (var i = 0; i < input.length; i++) {
- var inputi = input[i];
-
- if (typeof inputi === "string") {
- res += inputi;
- } else {
- res += texify._go2(inputi);
-
- if (inputi.type_ === '1st-level escape') {
- cee = true;
- }
- }
- }
-
- if (!isInner && !cee && res) {
- res = "{" + res + "}";
- }
-
- return res;
- },
- _goInner: function _goInner(input) {
- if (!input) {
- return input;
- }
-
- return texify.go(input, true);
- },
- _go2: function _go2(buf) {
- /** @type {undefined | string} */
- var res;
-
- switch (buf.type_) {
- case 'chemfive':
- res = "";
- var b5 = {
- a: texify._goInner(buf.a),
- b: texify._goInner(buf.b),
- p: texify._goInner(buf.p),
- o: texify._goInner(buf.o),
- q: texify._goInner(buf.q),
- d: texify._goInner(buf.d)
- }; //
- // a
- //
-
- if (b5.a) {
- if (b5.a.match(/^[+\-]/)) {
- b5.a = "{" + b5.a + "}";
- }
-
- res += b5.a + "\\,";
- } //
- // b and p
- //
-
-
- if (b5.b || b5.p) {
- res += "{\\vphantom{X}}";
- res += "^{\\hphantom{" + (b5.b || "") + "}}_{\\hphantom{" + (b5.p || "") + "}}";
- res += "{\\vphantom{X}}";
- res += "^{\\smash[t]{\\vphantom{2}}\\mathllap{" + (b5.b || "") + "}}";
- res += "_{\\vphantom{2}\\mathllap{\\smash[t]{" + (b5.p || "") + "}}}";
- } //
- // o
- //
-
-
- if (b5.o) {
- if (b5.o.match(/^[+\-]/)) {
- b5.o = "{" + b5.o + "}";
- }
-
- res += b5.o;
- } //
- // q and d
- //
-
-
- if (buf.dType === 'kv') {
- if (b5.d || b5.q) {
- res += "{\\vphantom{X}}";
- }
-
- if (b5.d) {
- res += "^{" + b5.d + "}";
- }
-
- if (b5.q) {
- res += "_{\\smash[t]{" + b5.q + "}}";
- }
- } else if (buf.dType === 'oxidation') {
- if (b5.d) {
- res += "{\\vphantom{X}}";
- res += "^{" + b5.d + "}";
- }
-
- if (b5.q) {
- res += "{\\vphantom{X}}";
- res += "_{\\smash[t]{" + b5.q + "}}";
- }
- } else {
- if (b5.q) {
- res += "{\\vphantom{X}}";
- res += "_{\\smash[t]{" + b5.q + "}}";
- }
-
- if (b5.d) {
- res += "{\\vphantom{X}}";
- res += "^{" + b5.d + "}";
- }
- }
-
- break;
-
- case 'rm':
- res = "\\mathrm{" + buf.p1 + "}";
- break;
-
- case 'text':
- if (buf.p1.match(/[\^_]/)) {
- buf.p1 = buf.p1.replace(" ", "~").replace("-", "\\text{-}");
- res = "\\mathrm{" + buf.p1 + "}";
- } else {
- res = "\\text{" + buf.p1 + "}";
- }
-
- break;
-
- case 'roman numeral':
- res = "\\mathrm{" + buf.p1 + "}";
- break;
-
- case 'state of aggregation':
- res = "\\mskip2mu " + texify._goInner(buf.p1);
- break;
-
- case 'state of aggregation subscript':
- res = "\\mskip1mu " + texify._goInner(buf.p1);
- break;
-
- case 'bond':
- res = texify._getBond(buf.kind_);
-
- if (!res) {
- throw ["MhchemErrorBond", "mhchem Error. Unknown bond type (" + buf.kind_ + ")"];
- }
-
- break;
-
- case 'frac':
- var c = "\\frac{" + buf.p1 + "}{" + buf.p2 + "}";
- res = "\\mathchoice{\\textstyle" + c + "}{" + c + "}{" + c + "}{" + c + "}";
- break;
-
- case 'pu-frac':
- var d = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
- res = "\\mathchoice{\\textstyle" + d + "}{" + d + "}{" + d + "}{" + d + "}";
- break;
-
- case 'tex-math':
- res = buf.p1 + " ";
- break;
-
- case 'frac-ce':
- res = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
- break;
-
- case 'overset':
- res = "\\overset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
- break;
-
- case 'underset':
- res = "\\underset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
- break;
-
- case 'underbrace':
- res = "\\underbrace{" + texify._goInner(buf.p1) + "}_{" + texify._goInner(buf.p2) + "}";
- break;
-
- case 'color':
- res = "{\\color{" + buf.color1 + "}{" + texify._goInner(buf.color2) + "}}";
- break;
-
- case 'color0':
- res = "\\color{" + buf.color + "}";
- break;
-
- case 'arrow':
- var b6 = {
- rd: texify._goInner(buf.rd),
- rq: texify._goInner(buf.rq)
- };
-
- var arrow = "\\x" + texify._getArrow(buf.r);
-
- if (b6.rq) {
- arrow += "[{" + b6.rq + "}]";
- }
-
- if (b6.rd) {
- arrow += "{" + b6.rd + "}";
- } else {
- arrow += "{}";
- }
-
- res = arrow;
- break;
-
- case 'operator':
- res = texify._getOperator(buf.kind_);
- break;
-
- case '1st-level escape':
- res = buf.p1 + " "; // &, \\\\, \\hlin
-
- break;
-
- case 'space':
- res = " ";
- break;
-
- case 'entitySkip':
- res = "~";
- break;
-
- case 'pu-space-1':
- res = "~";
- break;
-
- case 'pu-space-2':
- res = "\\mkern3mu ";
- break;
-
- case '1000 separator':
- res = "\\mkern2mu ";
- break;
-
- case 'commaDecimal':
- res = "{,}";
- break;
-
- case 'comma enumeration L':
- res = "{" + buf.p1 + "}\\mkern6mu ";
- break;
-
- case 'comma enumeration M':
- res = "{" + buf.p1 + "}\\mkern3mu ";
- break;
-
- case 'comma enumeration S':
- res = "{" + buf.p1 + "}\\mkern1mu ";
- break;
-
- case 'hyphen':
- res = "\\text{-}";
- break;
-
- case 'addition compound':
- res = "\\,{\\cdot}\\,";
- break;
-
- case 'electron dot':
- res = "\\mkern1mu \\bullet\\mkern1mu ";
- break;
-
- case 'KV x':
- res = "{\\times}";
- break;
-
- case 'prime':
- res = "\\prime ";
- break;
-
- case 'cdot':
- res = "\\cdot ";
- break;
-
- case 'tight cdot':
- res = "\\mkern1mu{\\cdot}\\mkern1mu ";
- break;
-
- case 'times':
- res = "\\times ";
- break;
-
- case 'circa':
- res = "{\\sim}";
- break;
-
- case '^':
- res = "uparrow";
- break;
-
- case 'v':
- res = "downarrow";
- break;
-
- case 'ellipsis':
- res = "\\ldots ";
- break;
-
- case '/':
- res = "/";
- break;
-
- case ' / ':
- res = "\\,/\\,";
- break;
-
- default:
- assertNever(buf);
- throw ["MhchemBugT", "mhchem bug T. Please report."];
- // Missing texify rule or unknown MhchemParser output
- }
-
- assertString(res);
- return res;
- },
- _getArrow: function _getArrow(a) {
- switch (a) {
- case "->":
- return "rightarrow";
-
- case "\u2192":
- return "rightarrow";
-
- case "\u27F6":
- return "rightarrow";
-
- case "<-":
- return "leftarrow";
-
- case "<->":
- return "leftrightarrow";
-
- case "<-->":
- return "rightleftarrows";
-
- case "<=>":
- return "rightleftharpoons";
-
- case "\u21CC":
- return "rightleftharpoons";
-
- case "<=>>":
- return "rightequilibrium";
-
- case "<<=>":
- return "leftequilibrium";
-
- default:
- assertNever(a);
- throw ["MhchemBugT", "mhchem bug T. Please report."];
- }
- },
- _getBond: function _getBond(a) {
- switch (a) {
- case "-":
- return "{-}";
-
- case "1":
- return "{-}";
-
- case "=":
- return "{=}";
-
- case "2":
- return "{=}";
-
- case "#":
- return "{\\equiv}";
-
- case "3":
- return "{\\equiv}";
-
- case "~":
- return "{\\tripledash}";
-
- case "~-":
- return "{\\mathrlap{\\raisebox{-.1em}{$-$}}\\raisebox{.1em}{$\\tripledash$}}";
-
- case "~=":
- return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";
-
- case "~--":
- return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";
-
- case "-~-":
- return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$-$}}\\tripledash}";
-
- case "...":
- return "{{\\cdot}{\\cdot}{\\cdot}}";
-
- case "....":
- return "{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";
-
- case "->":
- return "{\\rightarrow}";
-
- case "<-":
- return "{\\leftarrow}";
-
- case "<":
- return "{<}";
-
- case ">":
- return "{>}";
-
- default:
- assertNever(a);
- throw ["MhchemBugT", "mhchem bug T. Please report."];
- }
- },
- _getOperator: function _getOperator(a) {
- switch (a) {
- case "+":
- return " {}+{} ";
-
- case "-":
- return " {}-{} ";
-
- case "=":
- return " {}={} ";
-
- case "<":
- return " {}<{} ";
-
- case ">":
- return " {}>{} ";
-
- case "<<":
- return " {}\\ll{} ";
-
- case ">>":
- return " {}\\gg{} ";
-
- case "\\pm":
- return " {}\\pm{} ";
-
- case "\\approx":
- return " {}\\approx{} ";
-
- case "$\\approx$":
- return " {}\\approx{} ";
-
- case "v":
- return " \\downarrow{} ";
-
- case "(v)":
- return " \\downarrow{} ";
-
- case "^":
- return " \\uparrow{} ";
-
- case "(^)":
- return " \\uparrow{} ";
-
- default:
- assertNever(a);
- throw ["MhchemBugT", "mhchem bug T. Please report."];
- }
- }
-}; //
-// Helpers for code analysis
-// Will show type error at calling position
-//
-
-/** @param {number} a */
-
-function assertNever(a) {}
-/** @param {string} a */
-
-
-function assertString(a) {}
-}();
-__webpack_exports__ = __webpack_exports__["default"];
-/******/ return __webpack_exports__;
-/******/ })()
-;
-});
\ No newline at end of file
diff --git a/javascripts/katex/contrib/mhchem.min.js b/javascripts/katex/contrib/mhchem.min.js
deleted file mode 100644
index 63c7ec0..0000000
--- a/javascripts/katex/contrib/mhchem.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],e);else{var n="object"==typeof exports?e(require("katex")):e(t.katex);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}("undefined"!=typeof self?self:this,(function(t){return function(){"use strict";var e={771:function(e){e.exports=t}},n={};function o(t){var a=n[t];if(void 0!==a)return a.exports;var r=n[t]={exports:{}};return e[t](r,r.exports,o),r.exports}o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var a={};return function(){var t=o(771),e=o.n(t);e().__defineMacro("\\ce",(function(t){return n(t.consumeArgs(1)[0],"ce")})),e().__defineMacro("\\pu",(function(t){return n(t.consumeArgs(1)[0],"pu")})),e().__defineMacro("\\tripledash","{\\vphantom{-}\\raisebox{2.56mu}{$\\mkern2mu\\tiny\\text{-}\\mkern1mu\\text{-}\\mkern1mu\\text{-}\\mkern2mu$}}");var n=function(t,e){for(var n="",o=t.length&&t[t.length-1].loc.start,i=t.length-1;i>=0;i--)t[i].loc.start>o&&(n+=" ",o=t[i].loc.start),n+=t[i].text,o+=t[i].text.length;return r.go(a.go(n,e))},a={go:function(t,e){if(!t)return[];void 0===e&&(e="ce");var n,o="0",r={};r.parenthesisLevel=0,t=(t=(t=t.replace(/\n/g," ")).replace(/[\u2212\u2013\u2014\u2010]/g,"-")).replace(/[\u2026]/g,"...");for(var i=10,c=[];;){n!==t?(i=10,n=t):i--;var u=a.stateMachines[e],p=u.transitions[o]||u.transitions["*"];t:for(var s=0;s0))return c;if(d.revisit||(t=_.remainder),!d.toContinue)break t}}if(i<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(t,e){if(e)if(Array.isArray(e))for(var n=0;n":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(t){return a.patterns.findObserveGroups(t,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(t){return a.patterns.findObserveGroups(t,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(t){return a.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(t){return a.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(t){return a.patterns.findObserveGroups(t,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(t){return a.patterns.findObserveGroups(t,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(t){return a.patterns.findObserveGroups(t,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(t){return a.patterns.findObserveGroups(t,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(t){return a.patterns.findObserveGroups(t,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(t){return a.patterns.findObserveGroups(t,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(t){return a.patterns.findObserveGroups(t,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(t){return a.patterns.findObserveGroups(t,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(t){var e;if(e=t.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/))return{match_:e[0],remainder:t.substr(e[0].length)};var n=a.patterns.findObserveGroups(t,"","$","$","");return n&&(e=n.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/))?{match_:e[0],remainder:t.substr(e[0].length)}:null},amount2:function(t){return this.amount(t)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(t){if(t.match(/^\([a-z]+\)$/))return null;var e=t.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return e?{match_:e[0],remainder:t.substr(e[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(t,e,n,o,a,r,i,c,u,p){var s=function(t,e){if("string"==typeof e)return 0!==t.indexOf(e)?null:e;var n=t.match(e);return n?n[0]:null},_=s(t,e);if(null===_)return null;if(t=t.substr(_.length),null===(_=s(t,n)))return null;var d=function(t,e,n){for(var o=0;e":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(t,e){var n;if((t.d||"").match(/^[0-9]+$/)){var o=t.d;t.d=void 0,n=this.output(t),t.b=o}else n=this.output(t);return a.actions["o="](t,e),n},"d= kv":function(t,e){t.d=e,t.dType="kv"},"charge or bond":function(t,e){if(t.beginsWithBond){var n=[];return a.concatArray(n,this.output(t)),a.concatArray(n,a.actions.bond(t,e,"-")),n}t.d=e},"- after o/d":function(t,e,n){var o=a.patterns.match_("orbital",t.o||""),r=a.patterns.match_("one lowercase greek letter $",t.o||""),i=a.patterns.match_("one lowercase latin letter $",t.o||""),c=a.patterns.match_("$one lowercase latin letter$ $",t.o||""),u="-"===e&&(o&&""===o.remainder||r||i||c);!u||t.a||t.b||t.p||t.d||t.q||o||!i||(t.o="$"+t.o+"$");var p=[];return u?(a.concatArray(p,this.output(t)),p.push({type_:"hyphen"})):(o=a.patterns.match_("digits",t.d||""),n&&o&&""===o.remainder?(a.concatArray(p,a.actions["d="](t,e)),a.concatArray(p,this.output(t))):(a.concatArray(p,this.output(t)),a.concatArray(p,a.actions.bond(t,e,"-")))),p},"a to o":function(t){t.o=t.a,t.a=void 0},"sb=true":function(t){t.sb=!0},"sb=false":function(t){t.sb=!1},"beginsWithBond=true":function(t){t.beginsWithBond=!0},"beginsWithBond=false":function(t){t.beginsWithBond=!1},"parenthesisLevel++":function(t){t.parenthesisLevel++},"parenthesisLevel--":function(t){t.parenthesisLevel--},"state of aggregation":function(t,e){return{type_:"state of aggregation",p1:a.go(e,"o")}},comma:function(t,e){var n=e.replace(/\s*$/,"");return n!==e&&0===t.parenthesisLevel?{type_:"comma enumeration L",p1:n}:{type_:"comma enumeration M",p1:n}},output:function(t,e,n){var o,r,i;t.r?(r="M"===t.rdt?a.go(t.rd,"tex-math"):"T"===t.rdt?[{type_:"text",p1:t.rd||""}]:a.go(t.rd),i="M"===t.rqt?a.go(t.rq,"tex-math"):"T"===t.rqt?[{type_:"text",p1:t.rq||""}]:a.go(t.rq),o={type_:"arrow",r:t.r,rd:r,rq:i}):(o=[],(t.a||t.b||t.p||t.o||t.q||t.d||n)&&(t.sb&&o.push({type_:"entitySkip"}),t.o||t.q||t.d||t.b||t.p||2===n?t.o||t.q||t.d||!t.b&&!t.p?t.o&&"kv"===t.dType&&a.patterns.match_("d-oxidation$",t.d||"")?t.dType="oxidation":t.o&&"kv"===t.dType&&!t.q&&(t.dType=void 0):(t.o=t.a,t.d=t.b,t.q=t.p,t.a=t.b=t.p=void 0):(t.o=t.a,t.a=void 0),o.push({type_:"chemfive",a:a.go(t.a,"a"),b:a.go(t.b,"bd"),p:a.go(t.p,"pq"),o:a.go(t.o,"o"),q:a.go(t.q,"pq"),d:a.go(t.d,"oxidation"===t.dType?"oxidation":"bd"),dType:t.dType})));for(var c in t)"parenthesisLevel"!==c&&"beginsWithBond"!==c&&delete t[c];return o},"oxidation-output":function(t,e){var n=["{"];return a.concatArray(n,a.go(e,"oxidation")),n.push("}"),n},"frac-output":function(t,e){return{type_:"frac-ce",p1:a.go(e[0]),p2:a.go(e[1])}},"overset-output":function(t,e){return{type_:"overset",p1:a.go(e[0]),p2:a.go(e[1])}},"underset-output":function(t,e){return{type_:"underset",p1:a.go(e[0]),p2:a.go(e[1])}},"underbrace-output":function(t,e){return{type_:"underbrace",p1:a.go(e[0]),p2:a.go(e[1])}},"color-output":function(t,e){return{type_:"color",color1:e[0],color2:a.go(e[1])}},"r=":function(t,e){t.r=e},"rdt=":function(t,e){t.rdt=e},"rd=":function(t,e){t.rd=e},"rqt=":function(t,e){t.rqt=e},"rq=":function(t,e){t.rq=e},operator:function(t,e,n){return{type_:"operator",kind_:n||e}}}},a:{transitions:a.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:a.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:a.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(t){if(t.text_){var e={type_:"text",p1:t.text_};for(var n in t)delete t[n];return e}}}},pq:{transitions:a.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(t,e){return{type_:"state of aggregation subscript",p1:a.go(e,"o")}},"color-output":function(t,e){return{type_:"color",color1:e[0],color2:a.go(e[1],"pq")}}}},bd:{transitions:a.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(t,e){return{type_:"color",color1:e[0],color2:a.go(e[1],"bd")}}}},oxidation:{transitions:a.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(t,e){return{type_:"roman numeral",p1:e||""}}}},"tex-math":{transitions:a.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(t){if(t.o){var e={type_:"tex-math",p1:t.o};for(var n in t)delete t[n];return e}}}},"tex-math tight":{transitions:a.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(t,e){t.o=(t.o||"")+"{"+e+"}"},output:function(t){if(t.o){var e={type_:"tex-math",p1:t.o};for(var n in t)delete t[n];return e}}}},"9,9":{transitions:a.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:a.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(t,e){var n=[];return"+-"===e[0]||"+/-"===e[0]?n.push("\\pm "):e[0]&&n.push(e[0]),e[1]&&(a.concatArray(n,a.go(e[1],"pu-9,9")),e[2]&&(e[2].match(/[,.]/)?a.concatArray(n,a.go(e[2],"pu-9,9")):n.push(e[2])),e[3]=e[4]||e[3],e[3]&&(e[3]=e[3].trim(),"e"===e[3]||"*"===e[3].substr(0,1)?n.push({type_:"cdot"}):n.push({type_:"times"}))),e[3]&&n.push("10^{"+e[5]+"}"),n},"number^":function(t,e){var n=[];return"+-"===e[0]||"+/-"===e[0]?n.push("\\pm "):e[0]&&n.push(e[0]),a.concatArray(n,a.go(e[1],"pu-9,9")),n.push("^{"+e[2]+"}"),n},operator:function(t,e,n){return{type_:"operator",kind_:n||e}},space:function(){return{type_:"pu-space-1"}},output:function(t){var e,n=a.patterns.match_("{(...)}",t.d||"");n&&""===n.remainder&&(t.d=n.match_);var o=a.patterns.match_("{(...)}",t.q||"");if(o&&""===o.remainder&&(t.q=o.match_),t.d&&(t.d=t.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.d=t.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),t.q){t.q=t.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.q=t.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var r={d:a.go(t.d,"pu"),q:a.go(t.q,"pu")};"//"===t.o?e={type_:"pu-frac",p1:r.d,p2:r.q}:(e=r.d,r.d.length>1||r.q.length>1?e.push({type_:" / "}):e.push({type_:"/"}),a.concatArray(e,r.q))}else e=a.go(t.d,"pu-2");for(var i in t)delete t[i];return e}}},"pu-2":{transitions:a.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(t,e){t.rm+="^{"+e+"}"},space:function(){return{type_:"pu-space-2"}},output:function(t){var e=[];if(t.rm){var n=a.patterns.match_("{(...)}",t.rm||"");e=n&&""===n.remainder?a.go(n.match_,"pu"):{type_:"rm",p1:t.rm}}for(var o in t)delete t[o];return e}}},"pu-9,9":{transitions:a.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(t){var e=[];if(t.text_=t.text_||"",t.text_.length>4){var n=t.text_.length%3;0===n&&(n=3);for(var o=t.text_.length-3;o>0;o-=3)e.push(t.text_.substr(o,3)),e.push({type_:"1000 separator"});e.push(t.text_.substr(0,n)),e.reverse()}else e.push(t.text_);for(var a in t)delete t[a];return e},"output-o":function(t){var e=[];if(t.text_=t.text_||"",t.text_.length>4){for(var n=t.text_.length-3,o=0;o":case"\u2192":case"\u27f6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<--\x3e":return"rightleftarrows";case"<=>":case"\u21cc":return"rightleftharpoons";case"<=>>":return"rightequilibrium";case"<<=>":return"leftequilibrium";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(t){switch(t){case"-":case"1":return"{-}";case"=":case"2":return"{=}";case"#":case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\mathrlap{\\raisebox{-.1em}{$-$}}\\raisebox{.1em}{$\\tripledash$}}";case"~=":case"~--":return"{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";case"-~-":return"{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$-$}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(t){switch(t){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":case"$\\approx$":return" {}\\approx{} ";case"v":case"(v)":return" \\downarrow{} ";case"^":case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}}}(),a=a.default}()}));
\ No newline at end of file
diff --git a/javascripts/katex/contrib/mhchem.mjs b/javascripts/katex/contrib/mhchem.mjs
deleted file mode 100644
index 7d93825..0000000
--- a/javascripts/katex/contrib/mhchem.mjs
+++ /dev/null
@@ -1,3109 +0,0 @@
-import katex from '../katex.mjs';
-
-/* eslint-disable */
-
-/* -*- Mode: JavaScript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
-
-/* vim: set ts=2 et sw=2 tw=80: */
-
-/*************************************************************
- *
- * KaTeX mhchem.js
- *
- * This file implements a KaTeX version of mhchem version 3.3.0.
- * It is adapted from MathJax/extensions/TeX/mhchem.js
- * It differs from the MathJax version as follows:
- * 1. The interface is changed so that it can be called from KaTeX, not MathJax.
- * 2. \rlap and \llap are replaced with \mathrlap and \mathllap.
- * 3. Four lines of code are edited in order to use \raisebox instead of \raise.
- * 4. The reaction arrow code is simplified. All reaction arrows are rendered
- * using KaTeX extensible arrows instead of building non-extensible arrows.
- * 5. \tripledash vertical alignment is slightly adjusted.
- *
- * This code, as other KaTeX code, is released under the MIT license.
- *
- * /*************************************************************
- *
- * MathJax/extensions/TeX/mhchem.js
- *
- * Implements the \ce command for handling chemical formulas
- * from the mhchem LaTeX package.
- *
- * ---------------------------------------------------------------------
- *
- * Copyright (c) 2011-2015 The MathJax Consortium
- * Copyright (c) 2015-2018 Martin Hensel
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-// Coding Style
-// - use '' for identifiers that can by minified/uglified
-// - use "" for strings that need to stay untouched
-// version: "3.3.0" for MathJax and KaTeX
-// Add \ce, \pu, and \tripledash to the KaTeX macros.
-katex.__defineMacro("\\ce", function (context) {
- return chemParse(context.consumeArgs(1)[0], "ce");
-});
-
-katex.__defineMacro("\\pu", function (context) {
- return chemParse(context.consumeArgs(1)[0], "pu");
-}); // Needed for \bond for the ~ forms
-// Raise by 2.56mu, not 2mu. We're raising a hyphen-minus, U+002D, not
-// a mathematical minus, U+2212. So we need that extra 0.56.
-
-
-katex.__defineMacro("\\tripledash", "{\\vphantom{-}\\raisebox{2.56mu}{$\\mkern2mu" + "\\tiny\\text{-}\\mkern1mu\\text{-}\\mkern1mu\\text{-}\\mkern2mu$}}");
-// This is the main function for handing the \ce and \pu commands.
-// It takes the argument to \ce or \pu and returns the corresponding TeX string.
-//
-
-var chemParse = function chemParse(tokens, stateMachine) {
- // Recreate the argument string from KaTeX's array of tokens.
- var str = "";
- var expectedLoc = tokens.length && tokens[tokens.length - 1].loc.start;
-
- for (var i = tokens.length - 1; i >= 0; i--) {
- if (tokens[i].loc.start > expectedLoc) {
- // context.consumeArgs has eaten a space.
- str += " ";
- expectedLoc = tokens[i].loc.start;
- }
-
- str += tokens[i].text;
- expectedLoc += tokens[i].text.length;
- }
-
- var tex = texify.go(mhchemParser.go(str, stateMachine));
- return tex;
-}; //
-// Core parser for mhchem syntax (recursive)
-//
-
-/** @type {MhchemParser} */
-
-
-var mhchemParser = {
- //
- // Parses mchem \ce syntax
- //
- // Call like
- // go("H2O");
- //
- go: function go(input, stateMachine) {
- if (!input) {
- return [];
- }
-
- if (stateMachine === undefined) {
- stateMachine = 'ce';
- }
-
- var state = '0'; //
- // String buffers for parsing:
- //
- // buffer.a == amount
- // buffer.o == element
- // buffer.b == left-side superscript
- // buffer.p == left-side subscript
- // buffer.q == right-side subscript
- // buffer.d == right-side superscript
- //
- // buffer.r == arrow
- // buffer.rdt == arrow, script above, type
- // buffer.rd == arrow, script above, content
- // buffer.rqt == arrow, script below, type
- // buffer.rq == arrow, script below, content
- //
- // buffer.text_
- // buffer.rm
- // etc.
- //
- // buffer.parenthesisLevel == int, starting at 0
- // buffer.sb == bool, space before
- // buffer.beginsWithBond == bool
- //
- // These letters are also used as state names.
- //
- // Other states:
- // 0 == begin of main part (arrow/operator unlikely)
- // 1 == next entity
- // 2 == next entity (arrow/operator unlikely)
- // 3 == next atom
- // c == macro
- //
-
- /** @type {Buffer} */
-
- var buffer = {};
- buffer['parenthesisLevel'] = 0;
- input = input.replace(/\n/g, " ");
- input = input.replace(/[\u2212\u2013\u2014\u2010]/g, "-");
- input = input.replace(/[\u2026]/g, "..."); //
- // Looks through mhchemParser.transitions, to execute a matching action
- // (recursive)
- //
-
- var lastInput;
- var watchdog = 10;
- /** @type {ParserOutput[]} */
-
- var output = [];
-
- while (true) {
- if (lastInput !== input) {
- watchdog = 10;
- lastInput = input;
- } else {
- watchdog--;
- } //
- // Find actions in transition table
- //
-
-
- var machine = mhchemParser.stateMachines[stateMachine];
- var t = machine.transitions[state] || machine.transitions['*'];
-
- iterateTransitions: for (var i = 0; i < t.length; i++) {
- var matches = mhchemParser.patterns.match_(t[i].pattern, input);
-
- if (matches) {
- //
- // Execute actions
- //
- var task = t[i].task;
-
- for (var iA = 0; iA < task.action_.length; iA++) {
- var o; //
- // Find and execute action
- //
-
- if (machine.actions[task.action_[iA].type_]) {
- o = machine.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
- } else if (mhchemParser.actions[task.action_[iA].type_]) {
- o = mhchemParser.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
- } else {
- throw ["MhchemBugA", "mhchem bug A. Please report. (" + task.action_[iA].type_ + ")"]; // Trying to use non-existing action
- } //
- // Add output
- //
-
-
- mhchemParser.concatArray(output, o);
- } //
- // Set next state,
- // Shorten input,
- // Continue with next character
- // (= apply only one transition per position)
- //
-
-
- state = task.nextState || state;
-
- if (input.length > 0) {
- if (!task.revisit) {
- input = matches.remainder;
- }
-
- if (!task.toContinue) {
- break iterateTransitions;
- }
- } else {
- return output;
- }
- }
- } //
- // Prevent infinite loop
- //
-
-
- if (watchdog <= 0) {
- throw ["MhchemBugU", "mhchem bug U. Please report."]; // Unexpected character
- }
- }
- },
- concatArray: function concatArray(a, b) {
- if (b) {
- if (Array.isArray(b)) {
- for (var iB = 0; iB < b.length; iB++) {
- a.push(b[iB]);
- }
- } else {
- a.push(b);
- }
- }
- },
- patterns: {
- //
- // Matching patterns
- // either regexps or function that return null or {match_:"a", remainder:"bc"}
- //
- patterns: {
- // property names must not look like integers ("2") for correct property traversal order, later on
- 'empty': /^$/,
- 'else': /^./,
- 'else2': /^./,
- 'space': /^\s/,
- 'space A': /^\s(?=[A-Z\\$])/,
- 'space$': /^\s$/,
- 'a-z': /^[a-z]/,
- 'x': /^x/,
- 'x$': /^x$/,
- 'i$': /^i$/,
- 'letters': /^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,
- '\\greek': /^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,
- 'one lowercase latin letter $': /^(?:([a-z])(?:$|[^a-zA-Z]))$/,
- '$one lowercase latin letter$ $': /^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,
- 'one lowercase greek letter $': /^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,
- 'digits': /^[0-9]+/,
- '-9.,9': /^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,
- '-9.,9 no missing 0': /^[+\-]?[0-9]+(?:[.,][0-9]+)?/,
- '(-)(9.,9)(e)(99)': function e99(input) {
- var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);
-
- if (m && m[0]) {
- return {
- match_: m.splice(1),
- remainder: input.substr(m[0].length)
- };
- }
-
- return null;
- },
- '(-)(9)^(-9)': function _(input) {
- var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);
-
- if (m && m[0]) {
- return {
- match_: m.splice(1),
- remainder: input.substr(m[0].length)
- };
- }
-
- return null;
- },
- 'state of aggregation $': function stateOfAggregation$(input) {
- // ... or crystal system
- var a = mhchemParser.patterns.findObserveGroups(input, "", /^\([a-z]{1,3}(?=[\),])/, ")", ""); // (aq), (aq,$\infty$), (aq, sat)
-
- if (a && a.remainder.match(/^($|[\s,;\)\]\}])/)) {
- return a;
- } // AND end of 'phrase'
-
-
- var m = input.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/); // OR crystal system ($o$) (\ca$c$)
-
- if (m) {
- return {
- match_: m[0],
- remainder: input.substr(m[0].length)
- };
- }
-
- return null;
- },
- '_{(state of aggregation)}$': /^_\{(\([a-z]{1,3}\))\}/,
- '{[(': /^(?:\\\{|\[|\()/,
- ')]}': /^(?:\)|\]|\\\})/,
- ', ': /^[,;]\s*/,
- ',': /^[,;]/,
- '.': /^[.]/,
- '. ': /^([.\u22C5\u00B7\u2022])\s*/,
- '...': /^\.\.\.(?=$|[^.])/,
- '* ': /^([*])\s*/,
- '^{(...)}': function _(input) {
- return mhchemParser.patterns.findObserveGroups(input, "^{", "", "", "}");
- },
- '^($...$)': function $$(input) {
- return mhchemParser.patterns.findObserveGroups(input, "^", "$", "$", "");
- },
- '^a': /^\^([0-9]+|[^\\_])/,
- '^\\x{}{}': function x(input) {
- return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
- },
- '^\\x{}': function x(input) {
- return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", "");
- },
- '^\\x': /^\^(\\[a-zA-Z]+)\s*/,
- '^(-1)': /^\^(-?\d+)/,
- '\'': /^'/,
- '_{(...)}': function _(input) {
- return mhchemParser.patterns.findObserveGroups(input, "_{", "", "", "}");
- },
- '_($...$)': function _$$(input) {
- return mhchemParser.patterns.findObserveGroups(input, "_", "$", "$", "");
- },
- '_9': /^_([+\-]?[0-9]+|[^\\])/,
- '_\\x{}{}': function _X(input) {
- return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
- },
- '_\\x{}': function _X(input) {
- return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", "");
- },
- '_\\x': /^_(\\[a-zA-Z]+)\s*/,
- '^_': /^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,
- '{}': /^\{\}/,
- '{...}': function _(input) {
- return mhchemParser.patterns.findObserveGroups(input, "", "{", "}", "");
- },
- '{(...)}': function _(input) {
- return mhchemParser.patterns.findObserveGroups(input, "{", "", "", "}");
- },
- '$...$': function $$(input) {
- return mhchemParser.patterns.findObserveGroups(input, "", "$", "$", "");
- },
- '${(...)}$': function $$(input) {
- return mhchemParser.patterns.findObserveGroups(input, "${", "", "", "}$");
- },
- '$(...)$': function $$(input) {
- return mhchemParser.patterns.findObserveGroups(input, "$", "", "", "$");
- },
- '=<>': /^[=<>]/,
- '#': /^[#\u2261]/,
- '+': /^\+/,
- '-$': /^-(?=[\s_},;\]/]|$|\([a-z]+\))/,
- // -space -, -; -] -/ -$ -state-of-aggregation
- '-9': /^-(?=[0-9])/,
- '- orbital overlap': /^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,
- '-': /^-/,
- 'pm-operator': /^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,
- 'operator': /^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,
- 'arrowUpDown': /^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,
- '\\bond{(...)}': function bond(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\bond{", "", "", "}");
- },
- '->': /^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,
- 'CMT': /^[CMT](?=\[)/,
- '[(...)]': function _(input) {
- return mhchemParser.patterns.findObserveGroups(input, "[", "", "", "]");
- },
- '1st-level escape': /^(&|\\\\|\\hline)\s*/,
- '\\,': /^(?:\\[,\ ;:])/,
- // \\x - but output no space before
- '\\x{}{}': function x(input) {
- return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
- },
- '\\x{}': function x(input) {
- return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", "");
- },
- '\\ca': /^\\ca(?:\s+|(?![a-zA-Z]))/,
- '\\x': /^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,
- 'orbital': /^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,
- // only those with numbers in front, because the others will be formatted correctly anyway
- 'others': /^[\/~|]/,
- '\\frac{(...)}': function frac(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\frac{", "", "", "}", "{", "", "", "}");
- },
- '\\overset{(...)}': function overset(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\overset{", "", "", "}", "{", "", "", "}");
- },
- '\\underset{(...)}': function underset(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\underset{", "", "", "}", "{", "", "", "}");
- },
- '\\underbrace{(...)}': function underbrace(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\underbrace{", "", "", "}_", "{", "", "", "}");
- },
- '\\color{(...)}0': function color0(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}");
- },
- '\\color{(...)}{(...)}1': function color1(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}", "{", "", "", "}");
- },
- '\\color(...){(...)}2': function color2(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\color", "\\", "", /^(?=\{)/, "{", "", "", "}");
- },
- '\\ce{(...)}': function ce(input) {
- return mhchemParser.patterns.findObserveGroups(input, "\\ce{", "", "", "}");
- },
- 'oxidation$': /^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,
- 'd-oxidation$': /^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,
- // 0 could be oxidation or charge
- 'roman numeral': /^[IVX]+/,
- '1/2$': /^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,
- 'amount': function amount(input) {
- var match; // e.g. 2, 0.5, 1/2, -2, n/2, +; $a$ could be added later in parsing
-
- match = input.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/);
-
- if (match) {
- return {
- match_: match[0],
- remainder: input.substr(match[0].length)
- };
- }
-
- var a = mhchemParser.patterns.findObserveGroups(input, "", "$", "$", "");
-
- if (a) {
- // e.g. $2n-1$, $-$
- match = a.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/);
-
- if (match) {
- return {
- match_: match[0],
- remainder: input.substr(match[0].length)
- };
- }
- }
-
- return null;
- },
- 'amount2': function amount2(input) {
- return this['amount'](input);
- },
- '(KV letters),': /^(?:[A-Z][a-z]{0,2}|i)(?=,)/,
- 'formula$': function formula$(input) {
- if (input.match(/^\([a-z]+\)$/)) {
- return null;
- } // state of aggregation = no formula
-
-
- var match = input.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);
-
- if (match) {
- return {
- match_: match[0],
- remainder: input.substr(match[0].length)
- };
- }
-
- return null;
- },
- 'uprightEntities': /^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,
- '/': /^\s*(\/)\s*/,
- '//': /^\s*(\/\/)\s*/,
- '*': /^\s*[*.]\s*/
- },
- findObserveGroups: function findObserveGroups(input, begExcl, begIncl, endIncl, endExcl, beg2Excl, beg2Incl, end2Incl, end2Excl, combine) {
- /** @type {{(input: string, pattern: string | RegExp): string | string[] | null;}} */
- var _match = function _match(input, pattern) {
- if (typeof pattern === "string") {
- if (input.indexOf(pattern) !== 0) {
- return null;
- }
-
- return pattern;
- } else {
- var match = input.match(pattern);
-
- if (!match) {
- return null;
- }
-
- return match[0];
- }
- };
- /** @type {{(input: string, i: number, endChars: string | RegExp): {endMatchBegin: number, endMatchEnd: number} | null;}} */
-
-
- var _findObserveGroups = function _findObserveGroups(input, i, endChars) {
- var braces = 0;
-
- while (i < input.length) {
- var a = input.charAt(i);
-
- var match = _match(input.substr(i), endChars);
-
- if (match !== null && braces === 0) {
- return {
- endMatchBegin: i,
- endMatchEnd: i + match.length
- };
- } else if (a === "{") {
- braces++;
- } else if (a === "}") {
- if (braces === 0) {
- throw ["ExtraCloseMissingOpen", "Extra close brace or missing open brace"];
- } else {
- braces--;
- }
- }
-
- i++;
- }
-
- if (braces > 0) {
- return null;
- }
-
- return null;
- };
-
- var match = _match(input, begExcl);
-
- if (match === null) {
- return null;
- }
-
- input = input.substr(match.length);
- match = _match(input, begIncl);
-
- if (match === null) {
- return null;
- }
-
- var e = _findObserveGroups(input, match.length, endIncl || endExcl);
-
- if (e === null) {
- return null;
- }
-
- var match1 = input.substring(0, endIncl ? e.endMatchEnd : e.endMatchBegin);
-
- if (!(beg2Excl || beg2Incl)) {
- return {
- match_: match1,
- remainder: input.substr(e.endMatchEnd)
- };
- } else {
- var group2 = this.findObserveGroups(input.substr(e.endMatchEnd), beg2Excl, beg2Incl, end2Incl, end2Excl);
-
- if (group2 === null) {
- return null;
- }
- /** @type {string[]} */
-
-
- var matchRet = [match1, group2.match_];
- return {
- match_: combine ? matchRet.join("") : matchRet,
- remainder: group2.remainder
- };
- }
- },
- //
- // Matching function
- // e.g. match("a", input) will look for the regexp called "a" and see if it matches
- // returns null or {match_:"a", remainder:"bc"}
- //
- match_: function match_(m, input) {
- var pattern = mhchemParser.patterns.patterns[m];
-
- if (pattern === undefined) {
- throw ["MhchemBugP", "mhchem bug P. Please report. (" + m + ")"]; // Trying to use non-existing pattern
- } else if (typeof pattern === "function") {
- return mhchemParser.patterns.patterns[m](input); // cannot use cached var pattern here, because some pattern functions need this===mhchemParser
- } else {
- // RegExp
- var match = input.match(pattern);
-
- if (match) {
- var mm;
-
- if (match[2]) {
- mm = [match[1], match[2]];
- } else if (match[1]) {
- mm = match[1];
- } else {
- mm = match[0];
- }
-
- return {
- match_: mm,
- remainder: input.substr(match[0].length)
- };
- }
-
- return null;
- }
- }
- },
- //
- // Generic state machine actions
- //
- actions: {
- 'a=': function a(buffer, m) {
- buffer.a = (buffer.a || "") + m;
- },
- 'b=': function b(buffer, m) {
- buffer.b = (buffer.b || "") + m;
- },
- 'p=': function p(buffer, m) {
- buffer.p = (buffer.p || "") + m;
- },
- 'o=': function o(buffer, m) {
- buffer.o = (buffer.o || "") + m;
- },
- 'q=': function q(buffer, m) {
- buffer.q = (buffer.q || "") + m;
- },
- 'd=': function d(buffer, m) {
- buffer.d = (buffer.d || "") + m;
- },
- 'rm=': function rm(buffer, m) {
- buffer.rm = (buffer.rm || "") + m;
- },
- 'text=': function text(buffer, m) {
- buffer.text_ = (buffer.text_ || "") + m;
- },
- 'insert': function insert(buffer, m, a) {
- return {
- type_: a
- };
- },
- 'insert+p1': function insertP1(buffer, m, a) {
- return {
- type_: a,
- p1: m
- };
- },
- 'insert+p1+p2': function insertP1P2(buffer, m, a) {
- return {
- type_: a,
- p1: m[0],
- p2: m[1]
- };
- },
- 'copy': function copy(buffer, m) {
- return m;
- },
- 'rm': function rm(buffer, m) {
- return {
- type_: 'rm',
- p1: m || ""
- };
- },
- 'text': function text(buffer, m) {
- return mhchemParser.go(m, 'text');
- },
- '{text}': function text(buffer, m) {
- var ret = ["{"];
- mhchemParser.concatArray(ret, mhchemParser.go(m, 'text'));
- ret.push("}");
- return ret;
- },
- 'tex-math': function texMath(buffer, m) {
- return mhchemParser.go(m, 'tex-math');
- },
- 'tex-math tight': function texMathTight(buffer, m) {
- return mhchemParser.go(m, 'tex-math tight');
- },
- 'bond': function bond(buffer, m, k) {
- return {
- type_: 'bond',
- kind_: k || m
- };
- },
- 'color0-output': function color0Output(buffer, m) {
- return {
- type_: 'color0',
- color: m[0]
- };
- },
- 'ce': function ce(buffer, m) {
- return mhchemParser.go(m);
- },
- '1/2': function _(buffer, m) {
- /** @type {ParserOutput[]} */
- var ret = [];
-
- if (m.match(/^[+\-]/)) {
- ret.push(m.substr(0, 1));
- m = m.substr(1);
- }
-
- var n = m.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);
- n[1] = n[1].replace(/\$/g, "");
- ret.push({
- type_: 'frac',
- p1: n[1],
- p2: n[2]
- });
-
- if (n[3]) {
- n[3] = n[3].replace(/\$/g, "");
- ret.push({
- type_: 'tex-math',
- p1: n[3]
- });
- }
-
- return ret;
- },
- '9,9': function _(buffer, m) {
- return mhchemParser.go(m, '9,9');
- }
- },
- //
- // createTransitions
- // convert { 'letter': { 'state': { action_: 'output' } } } to { 'state' => [ { pattern: 'letter', task: { action_: [{type_: 'output'}] } } ] }
- // with expansion of 'a|b' to 'a' and 'b' (at 2 places)
- //
- createTransitions: function createTransitions(o) {
- var pattern, state;
- /** @type {string[]} */
-
- var stateArray;
- var i; //
- // 1. Collect all states
- //
-
- /** @type {Transitions} */
-
- var transitions = {};
-
- for (pattern in o) {
- for (state in o[pattern]) {
- stateArray = state.split("|");
- o[pattern][state].stateArray = stateArray;
-
- for (i = 0; i < stateArray.length; i++) {
- transitions[stateArray[i]] = [];
- }
- }
- } //
- // 2. Fill states
- //
-
-
- for (pattern in o) {
- for (state in o[pattern]) {
- stateArray = o[pattern][state].stateArray || [];
-
- for (i = 0; i < stateArray.length; i++) {
- //
- // 2a. Normalize actions into array: 'text=' ==> [{type_:'text='}]
- // (Note to myself: Resolving the function here would be problematic. It would need .bind (for *this*) and currying (for *option*).)
- //
-
- /** @type {any} */
- var p = o[pattern][state];
-
- if (p.action_) {
- p.action_ = [].concat(p.action_);
-
- for (var k = 0; k < p.action_.length; k++) {
- if (typeof p.action_[k] === "string") {
- p.action_[k] = {
- type_: p.action_[k]
- };
- }
- }
- } else {
- p.action_ = [];
- } //
- // 2.b Multi-insert
- //
-
-
- var patternArray = pattern.split("|");
-
- for (var j = 0; j < patternArray.length; j++) {
- if (stateArray[i] === '*') {
- // insert into all
- for (var t in transitions) {
- transitions[t].push({
- pattern: patternArray[j],
- task: p
- });
- }
- } else {
- transitions[stateArray[i]].push({
- pattern: patternArray[j],
- task: p
- });
- }
- }
- }
- }
- }
-
- return transitions;
- },
- stateMachines: {}
-}; //
-// Definition of state machines
-//
-
-mhchemParser.stateMachines = {
- //
- // \ce state machines
- //
- //#region ce
- 'ce': {
- // main parser
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {
- action_: 'output'
- }
- },
- 'else': {
- '0|1|2': {
- action_: 'beginsWithBond=false',
- revisit: true,
- toContinue: true
- }
- },
- 'oxidation$': {
- '0': {
- action_: 'oxidation-output'
- }
- },
- 'CMT': {
- 'r': {
- action_: 'rdt=',
- nextState: 'rt'
- },
- 'rd': {
- action_: 'rqt=',
- nextState: 'rdt'
- }
- },
- 'arrowUpDown': {
- '0|1|2|as': {
- action_: ['sb=false', 'output', 'operator'],
- nextState: '1'
- }
- },
- 'uprightEntities': {
- '0|1|2': {
- action_: ['o=', 'output'],
- nextState: '1'
- }
- },
- 'orbital': {
- '0|1|2|3': {
- action_: 'o=',
- nextState: 'o'
- }
- },
- '->': {
- '0|1|2|3': {
- action_: 'r=',
- nextState: 'r'
- },
- 'a|as': {
- action_: ['output', 'r='],
- nextState: 'r'
- },
- '*': {
- action_: ['output', 'r='],
- nextState: 'r'
- }
- },
- '+': {
- 'o': {
- action_: 'd= kv',
- nextState: 'd'
- },
- 'd|D': {
- action_: 'd=',
- nextState: 'd'
- },
- 'q': {
- action_: 'd=',
- nextState: 'qd'
- },
- 'qd|qD': {
- action_: 'd=',
- nextState: 'qd'
- },
- 'dq': {
- action_: ['output', 'd='],
- nextState: 'd'
- },
- '3': {
- action_: ['sb=false', 'output', 'operator'],
- nextState: '0'
- }
- },
- 'amount': {
- '0|2': {
- action_: 'a=',
- nextState: 'a'
- }
- },
- 'pm-operator': {
- '0|1|2|a|as': {
- action_: ['sb=false', 'output', {
- type_: 'operator',
- option: '\\pm'
- }],
- nextState: '0'
- }
- },
- 'operator': {
- '0|1|2|a|as': {
- action_: ['sb=false', 'output', 'operator'],
- nextState: '0'
- }
- },
- '-$': {
- 'o|q': {
- action_: ['charge or bond', 'output'],
- nextState: 'qd'
- },
- 'd': {
- action_: 'd=',
- nextState: 'd'
- },
- 'D': {
- action_: ['output', {
- type_: 'bond',
- option: "-"
- }],
- nextState: '3'
- },
- 'q': {
- action_: 'd=',
- nextState: 'qd'
- },
- 'qd': {
- action_: 'd=',
- nextState: 'qd'
- },
- 'qD|dq': {
- action_: ['output', {
- type_: 'bond',
- option: "-"
- }],
- nextState: '3'
- }
- },
- '-9': {
- '3|o': {
- action_: ['output', {
- type_: 'insert',
- option: 'hyphen'
- }],
- nextState: '3'
- }
- },
- '- orbital overlap': {
- 'o': {
- action_: ['output', {
- type_: 'insert',
- option: 'hyphen'
- }],
- nextState: '2'
- },
- 'd': {
- action_: ['output', {
- type_: 'insert',
- option: 'hyphen'
- }],
- nextState: '2'
- }
- },
- '-': {
- '0|1|2': {
- action_: [{
- type_: 'output',
- option: 1
- }, 'beginsWithBond=true', {
- type_: 'bond',
- option: "-"
- }],
- nextState: '3'
- },
- '3': {
- action_: {
- type_: 'bond',
- option: "-"
- }
- },
- 'a': {
- action_: ['output', {
- type_: 'insert',
- option: 'hyphen'
- }],
- nextState: '2'
- },
- 'as': {
- action_: [{
- type_: 'output',
- option: 2
- }, {
- type_: 'bond',
- option: "-"
- }],
- nextState: '3'
- },
- 'b': {
- action_: 'b='
- },
- 'o': {
- action_: {
- type_: '- after o/d',
- option: false
- },
- nextState: '2'
- },
- 'q': {
- action_: {
- type_: '- after o/d',
- option: false
- },
- nextState: '2'
- },
- 'd|qd|dq': {
- action_: {
- type_: '- after o/d',
- option: true
- },
- nextState: '2'
- },
- 'D|qD|p': {
- action_: ['output', {
- type_: 'bond',
- option: "-"
- }],
- nextState: '3'
- }
- },
- 'amount2': {
- '1|3': {
- action_: 'a=',
- nextState: 'a'
- }
- },
- 'letters': {
- '0|1|2|3|a|as|b|p|bp|o': {
- action_: 'o=',
- nextState: 'o'
- },
- 'q|dq': {
- action_: ['output', 'o='],
- nextState: 'o'
- },
- 'd|D|qd|qD': {
- action_: 'o after d',
- nextState: 'o'
- }
- },
- 'digits': {
- 'o': {
- action_: 'q=',
- nextState: 'q'
- },
- 'd|D': {
- action_: 'q=',
- nextState: 'dq'
- },
- 'q': {
- action_: ['output', 'o='],
- nextState: 'o'
- },
- 'a': {
- action_: 'o=',
- nextState: 'o'
- }
- },
- 'space A': {
- 'b|p|bp': {}
- },
- 'space': {
- 'a': {
- nextState: 'as'
- },
- '0': {
- action_: 'sb=false'
- },
- '1|2': {
- action_: 'sb=true'
- },
- 'r|rt|rd|rdt|rdq': {
- action_: 'output',
- nextState: '0'
- },
- '*': {
- action_: ['output', 'sb=true'],
- nextState: '1'
- }
- },
- '1st-level escape': {
- '1|2': {
- action_: ['output', {
- type_: 'insert+p1',
- option: '1st-level escape'
- }]
- },
- '*': {
- action_: ['output', {
- type_: 'insert+p1',
- option: '1st-level escape'
- }],
- nextState: '0'
- }
- },
- '[(...)]': {
- 'r|rt': {
- action_: 'rd=',
- nextState: 'rd'
- },
- 'rd|rdt': {
- action_: 'rq=',
- nextState: 'rdq'
- }
- },
- '...': {
- 'o|d|D|dq|qd|qD': {
- action_: ['output', {
- type_: 'bond',
- option: "..."
- }],
- nextState: '3'
- },
- '*': {
- action_: [{
- type_: 'output',
- option: 1
- }, {
- type_: 'insert',
- option: 'ellipsis'
- }],
- nextState: '1'
- }
- },
- '. |* ': {
- '*': {
- action_: ['output', {
- type_: 'insert',
- option: 'addition compound'
- }],
- nextState: '1'
- }
- },
- 'state of aggregation $': {
- '*': {
- action_: ['output', 'state of aggregation'],
- nextState: '1'
- }
- },
- '{[(': {
- 'a|as|o': {
- action_: ['o=', 'output', 'parenthesisLevel++'],
- nextState: '2'
- },
- '0|1|2|3': {
- action_: ['o=', 'output', 'parenthesisLevel++'],
- nextState: '2'
- },
- '*': {
- action_: ['output', 'o=', 'output', 'parenthesisLevel++'],
- nextState: '2'
- }
- },
- ')]}': {
- '0|1|2|3|b|p|bp|o': {
- action_: ['o=', 'parenthesisLevel--'],
- nextState: 'o'
- },
- 'a|as|d|D|q|qd|qD|dq': {
- action_: ['output', 'o=', 'parenthesisLevel--'],
- nextState: 'o'
- }
- },
- ', ': {
- '*': {
- action_: ['output', 'comma'],
- nextState: '0'
- }
- },
- '^_': {
- // ^ and _ without a sensible argument
- '*': {}
- },
- '^{(...)}|^($...$)': {
- '0|1|2|as': {
- action_: 'b=',
- nextState: 'b'
- },
- 'p': {
- action_: 'b=',
- nextState: 'bp'
- },
- '3|o': {
- action_: 'd= kv',
- nextState: 'D'
- },
- 'q': {
- action_: 'd=',
- nextState: 'qD'
- },
- 'd|D|qd|qD|dq': {
- action_: ['output', 'd='],
- nextState: 'D'
- }
- },
- '^a|^\\x{}{}|^\\x{}|^\\x|\'': {
- '0|1|2|as': {
- action_: 'b=',
- nextState: 'b'
- },
- 'p': {
- action_: 'b=',
- nextState: 'bp'
- },
- '3|o': {
- action_: 'd= kv',
- nextState: 'd'
- },
- 'q': {
- action_: 'd=',
- nextState: 'qd'
- },
- 'd|qd|D|qD': {
- action_: 'd='
- },
- 'dq': {
- action_: ['output', 'd='],
- nextState: 'd'
- }
- },
- '_{(state of aggregation)}$': {
- 'd|D|q|qd|qD|dq': {
- action_: ['output', 'q='],
- nextState: 'q'
- }
- },
- '_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x': {
- '0|1|2|as': {
- action_: 'p=',
- nextState: 'p'
- },
- 'b': {
- action_: 'p=',
- nextState: 'bp'
- },
- '3|o': {
- action_: 'q=',
- nextState: 'q'
- },
- 'd|D': {
- action_: 'q=',
- nextState: 'dq'
- },
- 'q|qd|qD|dq': {
- action_: ['output', 'q='],
- nextState: 'q'
- }
- },
- '=<>': {
- '0|1|2|3|a|as|o|q|d|D|qd|qD|dq': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'bond'],
- nextState: '3'
- }
- },
- '#': {
- '0|1|2|3|a|as|o': {
- action_: [{
- type_: 'output',
- option: 2
- }, {
- type_: 'bond',
- option: "#"
- }],
- nextState: '3'
- }
- },
- '{}': {
- '*': {
- action_: {
- type_: 'output',
- option: 1
- },
- nextState: '1'
- }
- },
- '{...}': {
- '0|1|2|3|a|as|b|p|bp': {
- action_: 'o=',
- nextState: 'o'
- },
- 'o|d|D|q|qd|qD|dq': {
- action_: ['output', 'o='],
- nextState: 'o'
- }
- },
- '$...$': {
- 'a': {
- action_: 'a='
- },
- // 2$n$
- '0|1|2|3|as|b|p|bp|o': {
- action_: 'o=',
- nextState: 'o'
- },
- // not 'amount'
- 'as|o': {
- action_: 'o='
- },
- 'q|d|D|qd|qD|dq': {
- action_: ['output', 'o='],
- nextState: 'o'
- }
- },
- '\\bond{(...)}': {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'bond'],
- nextState: "3"
- }
- },
- '\\frac{(...)}': {
- '*': {
- action_: [{
- type_: 'output',
- option: 1
- }, 'frac-output'],
- nextState: '3'
- }
- },
- '\\overset{(...)}': {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'overset-output'],
- nextState: '3'
- }
- },
- '\\underset{(...)}': {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'underset-output'],
- nextState: '3'
- }
- },
- '\\underbrace{(...)}': {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'underbrace-output'],
- nextState: '3'
- }
- },
- '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'color-output'],
- nextState: '3'
- }
- },
- '\\color{(...)}0': {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'color0-output']
- }
- },
- '\\ce{(...)}': {
- '*': {
- action_: [{
- type_: 'output',
- option: 2
- }, 'ce'],
- nextState: '3'
- }
- },
- '\\,': {
- '*': {
- action_: [{
- type_: 'output',
- option: 1
- }, 'copy'],
- nextState: '1'
- }
- },
- '\\x{}{}|\\x{}|\\x': {
- '0|1|2|3|a|as|b|p|bp|o|c0': {
- action_: ['o=', 'output'],
- nextState: '3'
- },
- '*': {
- action_: ['output', 'o=', 'output'],
- nextState: '3'
- }
- },
- 'others': {
- '*': {
- action_: [{
- type_: 'output',
- option: 1
- }, 'copy'],
- nextState: '3'
- }
- },
- 'else2': {
- 'a': {
- action_: 'a to o',
- nextState: 'o',
- revisit: true
- },
- 'as': {
- action_: ['output', 'sb=true'],
- nextState: '1',
- revisit: true
- },
- 'r|rt|rd|rdt|rdq': {
- action_: ['output'],
- nextState: '0',
- revisit: true
- },
- '*': {
- action_: ['output', 'copy'],
- nextState: '3'
- }
- }
- }),
- actions: {
- 'o after d': function oAfterD(buffer, m) {
- var ret;
-
- if ((buffer.d || "").match(/^[0-9]+$/)) {
- var tmp = buffer.d;
- buffer.d = undefined;
- ret = this['output'](buffer);
- buffer.b = tmp;
- } else {
- ret = this['output'](buffer);
- }
-
- mhchemParser.actions['o='](buffer, m);
- return ret;
- },
- 'd= kv': function dKv(buffer, m) {
- buffer.d = m;
- buffer.dType = 'kv';
- },
- 'charge or bond': function chargeOrBond(buffer, m) {
- if (buffer['beginsWithBond']) {
- /** @type {ParserOutput[]} */
- var ret = [];
- mhchemParser.concatArray(ret, this['output'](buffer));
- mhchemParser.concatArray(ret, mhchemParser.actions['bond'](buffer, m, "-"));
- return ret;
- } else {
- buffer.d = m;
- }
- },
- '- after o/d': function afterOD(buffer, m, isAfterD) {
- var c1 = mhchemParser.patterns.match_('orbital', buffer.o || "");
- var c2 = mhchemParser.patterns.match_('one lowercase greek letter $', buffer.o || "");
- var c3 = mhchemParser.patterns.match_('one lowercase latin letter $', buffer.o || "");
- var c4 = mhchemParser.patterns.match_('$one lowercase latin letter$ $', buffer.o || "");
- var hyphenFollows = m === "-" && (c1 && c1.remainder === "" || c2 || c3 || c4);
-
- if (hyphenFollows && !buffer.a && !buffer.b && !buffer.p && !buffer.d && !buffer.q && !c1 && c3) {
- buffer.o = '$' + buffer.o + '$';
- }
- /** @type {ParserOutput[]} */
-
-
- var ret = [];
-
- if (hyphenFollows) {
- mhchemParser.concatArray(ret, this['output'](buffer));
- ret.push({
- type_: 'hyphen'
- });
- } else {
- c1 = mhchemParser.patterns.match_('digits', buffer.d || "");
-
- if (isAfterD && c1 && c1.remainder === '') {
- mhchemParser.concatArray(ret, mhchemParser.actions['d='](buffer, m));
- mhchemParser.concatArray(ret, this['output'](buffer));
- } else {
- mhchemParser.concatArray(ret, this['output'](buffer));
- mhchemParser.concatArray(ret, mhchemParser.actions['bond'](buffer, m, "-"));
- }
- }
-
- return ret;
- },
- 'a to o': function aToO(buffer) {
- buffer.o = buffer.a;
- buffer.a = undefined;
- },
- 'sb=true': function sbTrue(buffer) {
- buffer.sb = true;
- },
- 'sb=false': function sbFalse(buffer) {
- buffer.sb = false;
- },
- 'beginsWithBond=true': function beginsWithBondTrue(buffer) {
- buffer['beginsWithBond'] = true;
- },
- 'beginsWithBond=false': function beginsWithBondFalse(buffer) {
- buffer['beginsWithBond'] = false;
- },
- 'parenthesisLevel++': function parenthesisLevel(buffer) {
- buffer['parenthesisLevel']++;
- },
- 'parenthesisLevel--': function parenthesisLevel(buffer) {
- buffer['parenthesisLevel']--;
- },
- 'state of aggregation': function stateOfAggregation(buffer, m) {
- return {
- type_: 'state of aggregation',
- p1: mhchemParser.go(m, 'o')
- };
- },
- 'comma': function comma(buffer, m) {
- var a = m.replace(/\s*$/, '');
- var withSpace = a !== m;
-
- if (withSpace && buffer['parenthesisLevel'] === 0) {
- return {
- type_: 'comma enumeration L',
- p1: a
- };
- } else {
- return {
- type_: 'comma enumeration M',
- p1: a
- };
- }
- },
- 'output': function output(buffer, m, entityFollows) {
- // entityFollows:
- // undefined = if we have nothing else to output, also ignore the just read space (buffer.sb)
- // 1 = an entity follows, never omit the space if there was one just read before (can only apply to state 1)
- // 2 = 1 + the entity can have an amount, so output a\, instead of converting it to o (can only apply to states a|as)
-
- /** @type {ParserOutput | ParserOutput[]} */
- var ret;
-
- if (!buffer.r) {
- ret = [];
-
- if (!buffer.a && !buffer.b && !buffer.p && !buffer.o && !buffer.q && !buffer.d && !entityFollows) ; else {
- if (buffer.sb) {
- ret.push({
- type_: 'entitySkip'
- });
- }
-
- if (!buffer.o && !buffer.q && !buffer.d && !buffer.b && !buffer.p && entityFollows !== 2) {
- buffer.o = buffer.a;
- buffer.a = undefined;
- } else if (!buffer.o && !buffer.q && !buffer.d && (buffer.b || buffer.p)) {
- buffer.o = buffer.a;
- buffer.d = buffer.b;
- buffer.q = buffer.p;
- buffer.a = buffer.b = buffer.p = undefined;
- } else {
- if (buffer.o && buffer.dType === 'kv' && mhchemParser.patterns.match_('d-oxidation$', buffer.d || "")) {
- buffer.dType = 'oxidation';
- } else if (buffer.o && buffer.dType === 'kv' && !buffer.q) {
- buffer.dType = undefined;
- }
- }
-
- ret.push({
- type_: 'chemfive',
- a: mhchemParser.go(buffer.a, 'a'),
- b: mhchemParser.go(buffer.b, 'bd'),
- p: mhchemParser.go(buffer.p, 'pq'),
- o: mhchemParser.go(buffer.o, 'o'),
- q: mhchemParser.go(buffer.q, 'pq'),
- d: mhchemParser.go(buffer.d, buffer.dType === 'oxidation' ? 'oxidation' : 'bd'),
- dType: buffer.dType
- });
- }
- } else {
- // r
-
- /** @type {ParserOutput[]} */
- var rd;
-
- if (buffer.rdt === 'M') {
- rd = mhchemParser.go(buffer.rd, 'tex-math');
- } else if (buffer.rdt === 'T') {
- rd = [{
- type_: 'text',
- p1: buffer.rd || ""
- }];
- } else {
- rd = mhchemParser.go(buffer.rd);
- }
- /** @type {ParserOutput[]} */
-
-
- var rq;
-
- if (buffer.rqt === 'M') {
- rq = mhchemParser.go(buffer.rq, 'tex-math');
- } else if (buffer.rqt === 'T') {
- rq = [{
- type_: 'text',
- p1: buffer.rq || ""
- }];
- } else {
- rq = mhchemParser.go(buffer.rq);
- }
-
- ret = {
- type_: 'arrow',
- r: buffer.r,
- rd: rd,
- rq: rq
- };
- }
-
- for (var p in buffer) {
- if (p !== 'parenthesisLevel' && p !== 'beginsWithBond') {
- delete buffer[p];
- }
- }
-
- return ret;
- },
- 'oxidation-output': function oxidationOutput(buffer, m) {
- var ret = ["{"];
- mhchemParser.concatArray(ret, mhchemParser.go(m, 'oxidation'));
- ret.push("}");
- return ret;
- },
- 'frac-output': function fracOutput(buffer, m) {
- return {
- type_: 'frac-ce',
- p1: mhchemParser.go(m[0]),
- p2: mhchemParser.go(m[1])
- };
- },
- 'overset-output': function oversetOutput(buffer, m) {
- return {
- type_: 'overset',
- p1: mhchemParser.go(m[0]),
- p2: mhchemParser.go(m[1])
- };
- },
- 'underset-output': function undersetOutput(buffer, m) {
- return {
- type_: 'underset',
- p1: mhchemParser.go(m[0]),
- p2: mhchemParser.go(m[1])
- };
- },
- 'underbrace-output': function underbraceOutput(buffer, m) {
- return {
- type_: 'underbrace',
- p1: mhchemParser.go(m[0]),
- p2: mhchemParser.go(m[1])
- };
- },
- 'color-output': function colorOutput(buffer, m) {
- return {
- type_: 'color',
- color1: m[0],
- color2: mhchemParser.go(m[1])
- };
- },
- 'r=': function r(buffer, m) {
- buffer.r = m;
- },
- 'rdt=': function rdt(buffer, m) {
- buffer.rdt = m;
- },
- 'rd=': function rd(buffer, m) {
- buffer.rd = m;
- },
- 'rqt=': function rqt(buffer, m) {
- buffer.rqt = m;
- },
- 'rq=': function rq(buffer, m) {
- buffer.rq = m;
- },
- 'operator': function operator(buffer, m, p1) {
- return {
- type_: 'operator',
- kind_: p1 || m
- };
- }
- }
- },
- 'a': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {}
- },
- '1/2$': {
- '0': {
- action_: '1/2'
- }
- },
- 'else': {
- '0': {
- nextState: '1',
- revisit: true
- }
- },
- '$(...)$': {
- '*': {
- action_: 'tex-math tight',
- nextState: '1'
- }
- },
- ',': {
- '*': {
- action_: {
- type_: 'insert',
- option: 'commaDecimal'
- }
- }
- },
- 'else2': {
- '*': {
- action_: 'copy'
- }
- }
- }),
- actions: {}
- },
- 'o': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {}
- },
- '1/2$': {
- '0': {
- action_: '1/2'
- }
- },
- 'else': {
- '0': {
- nextState: '1',
- revisit: true
- }
- },
- 'letters': {
- '*': {
- action_: 'rm'
- }
- },
- '\\ca': {
- '*': {
- action_: {
- type_: 'insert',
- option: 'circa'
- }
- }
- },
- '\\x{}{}|\\x{}|\\x': {
- '*': {
- action_: 'copy'
- }
- },
- '${(...)}$|$(...)$': {
- '*': {
- action_: 'tex-math'
- }
- },
- '{(...)}': {
- '*': {
- action_: '{text}'
- }
- },
- 'else2': {
- '*': {
- action_: 'copy'
- }
- }
- }),
- actions: {}
- },
- 'text': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {
- action_: 'output'
- }
- },
- '{...}': {
- '*': {
- action_: 'text='
- }
- },
- '${(...)}$|$(...)$': {
- '*': {
- action_: 'tex-math'
- }
- },
- '\\greek': {
- '*': {
- action_: ['output', 'rm']
- }
- },
- '\\,|\\x{}{}|\\x{}|\\x': {
- '*': {
- action_: ['output', 'copy']
- }
- },
- 'else': {
- '*': {
- action_: 'text='
- }
- }
- }),
- actions: {
- 'output': function output(buffer) {
- if (buffer.text_) {
- /** @type {ParserOutput} */
- var ret = {
- type_: 'text',
- p1: buffer.text_
- };
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- }
- }
- }
- },
- 'pq': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {}
- },
- 'state of aggregation $': {
- '*': {
- action_: 'state of aggregation'
- }
- },
- 'i$': {
- '0': {
- nextState: '!f',
- revisit: true
- }
- },
- '(KV letters),': {
- '0': {
- action_: 'rm',
- nextState: '0'
- }
- },
- 'formula$': {
- '0': {
- nextState: 'f',
- revisit: true
- }
- },
- '1/2$': {
- '0': {
- action_: '1/2'
- }
- },
- 'else': {
- '0': {
- nextState: '!f',
- revisit: true
- }
- },
- '${(...)}$|$(...)$': {
- '*': {
- action_: 'tex-math'
- }
- },
- '{(...)}': {
- '*': {
- action_: 'text'
- }
- },
- 'a-z': {
- 'f': {
- action_: 'tex-math'
- }
- },
- 'letters': {
- '*': {
- action_: 'rm'
- }
- },
- '-9.,9': {
- '*': {
- action_: '9,9'
- }
- },
- ',': {
- '*': {
- action_: {
- type_: 'insert+p1',
- option: 'comma enumeration S'
- }
- }
- },
- '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
- '*': {
- action_: 'color-output'
- }
- },
- '\\color{(...)}0': {
- '*': {
- action_: 'color0-output'
- }
- },
- '\\ce{(...)}': {
- '*': {
- action_: 'ce'
- }
- },
- '\\,|\\x{}{}|\\x{}|\\x': {
- '*': {
- action_: 'copy'
- }
- },
- 'else2': {
- '*': {
- action_: 'copy'
- }
- }
- }),
- actions: {
- 'state of aggregation': function stateOfAggregation(buffer, m) {
- return {
- type_: 'state of aggregation subscript',
- p1: mhchemParser.go(m, 'o')
- };
- },
- 'color-output': function colorOutput(buffer, m) {
- return {
- type_: 'color',
- color1: m[0],
- color2: mhchemParser.go(m[1], 'pq')
- };
- }
- }
- },
- 'bd': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {}
- },
- 'x$': {
- '0': {
- nextState: '!f',
- revisit: true
- }
- },
- 'formula$': {
- '0': {
- nextState: 'f',
- revisit: true
- }
- },
- 'else': {
- '0': {
- nextState: '!f',
- revisit: true
- }
- },
- '-9.,9 no missing 0': {
- '*': {
- action_: '9,9'
- }
- },
- '.': {
- '*': {
- action_: {
- type_: 'insert',
- option: 'electron dot'
- }
- }
- },
- 'a-z': {
- 'f': {
- action_: 'tex-math'
- }
- },
- 'x': {
- '*': {
- action_: {
- type_: 'insert',
- option: 'KV x'
- }
- }
- },
- 'letters': {
- '*': {
- action_: 'rm'
- }
- },
- '\'': {
- '*': {
- action_: {
- type_: 'insert',
- option: 'prime'
- }
- }
- },
- '${(...)}$|$(...)$': {
- '*': {
- action_: 'tex-math'
- }
- },
- '{(...)}': {
- '*': {
- action_: 'text'
- }
- },
- '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
- '*': {
- action_: 'color-output'
- }
- },
- '\\color{(...)}0': {
- '*': {
- action_: 'color0-output'
- }
- },
- '\\ce{(...)}': {
- '*': {
- action_: 'ce'
- }
- },
- '\\,|\\x{}{}|\\x{}|\\x': {
- '*': {
- action_: 'copy'
- }
- },
- 'else2': {
- '*': {
- action_: 'copy'
- }
- }
- }),
- actions: {
- 'color-output': function colorOutput(buffer, m) {
- return {
- type_: 'color',
- color1: m[0],
- color2: mhchemParser.go(m[1], 'bd')
- };
- }
- }
- },
- 'oxidation': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {}
- },
- 'roman numeral': {
- '*': {
- action_: 'roman-numeral'
- }
- },
- '${(...)}$|$(...)$': {
- '*': {
- action_: 'tex-math'
- }
- },
- 'else': {
- '*': {
- action_: 'copy'
- }
- }
- }),
- actions: {
- 'roman-numeral': function romanNumeral(buffer, m) {
- return {
- type_: 'roman numeral',
- p1: m || ""
- };
- }
- }
- },
- 'tex-math': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {
- action_: 'output'
- }
- },
- '\\ce{(...)}': {
- '*': {
- action_: ['output', 'ce']
- }
- },
- '{...}|\\,|\\x{}{}|\\x{}|\\x': {
- '*': {
- action_: 'o='
- }
- },
- 'else': {
- '*': {
- action_: 'o='
- }
- }
- }),
- actions: {
- 'output': function output(buffer) {
- if (buffer.o) {
- /** @type {ParserOutput} */
- var ret = {
- type_: 'tex-math',
- p1: buffer.o
- };
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- }
- }
- }
- },
- 'tex-math tight': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {
- action_: 'output'
- }
- },
- '\\ce{(...)}': {
- '*': {
- action_: ['output', 'ce']
- }
- },
- '{...}|\\,|\\x{}{}|\\x{}|\\x': {
- '*': {
- action_: 'o='
- }
- },
- '-|+': {
- '*': {
- action_: 'tight operator'
- }
- },
- 'else': {
- '*': {
- action_: 'o='
- }
- }
- }),
- actions: {
- 'tight operator': function tightOperator(buffer, m) {
- buffer.o = (buffer.o || "") + "{" + m + "}";
- },
- 'output': function output(buffer) {
- if (buffer.o) {
- /** @type {ParserOutput} */
- var ret = {
- type_: 'tex-math',
- p1: buffer.o
- };
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- }
- }
- }
- },
- '9,9': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {}
- },
- ',': {
- '*': {
- action_: 'comma'
- }
- },
- 'else': {
- '*': {
- action_: 'copy'
- }
- }
- }),
- actions: {
- 'comma': function comma() {
- return {
- type_: 'commaDecimal'
- };
- }
- }
- },
- //#endregion
- //
- // \pu state machines
- //
- //#region pu
- 'pu': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {
- action_: 'output'
- }
- },
- 'space$': {
- '*': {
- action_: ['output', 'space']
- }
- },
- '{[(|)]}': {
- '0|a': {
- action_: 'copy'
- }
- },
- '(-)(9)^(-9)': {
- '0': {
- action_: 'number^',
- nextState: 'a'
- }
- },
- '(-)(9.,9)(e)(99)': {
- '0': {
- action_: 'enumber',
- nextState: 'a'
- }
- },
- 'space': {
- '0|a': {}
- },
- 'pm-operator': {
- '0|a': {
- action_: {
- type_: 'operator',
- option: '\\pm'
- },
- nextState: '0'
- }
- },
- 'operator': {
- '0|a': {
- action_: 'copy',
- nextState: '0'
- }
- },
- '//': {
- 'd': {
- action_: 'o=',
- nextState: '/'
- }
- },
- '/': {
- 'd': {
- action_: 'o=',
- nextState: '/'
- }
- },
- '{...}|else': {
- '0|d': {
- action_: 'd=',
- nextState: 'd'
- },
- 'a': {
- action_: ['space', 'd='],
- nextState: 'd'
- },
- '/|q': {
- action_: 'q=',
- nextState: 'q'
- }
- }
- }),
- actions: {
- 'enumber': function enumber(buffer, m) {
- /** @type {ParserOutput[]} */
- var ret = [];
-
- if (m[0] === "+-" || m[0] === "+/-") {
- ret.push("\\pm ");
- } else if (m[0]) {
- ret.push(m[0]);
- }
-
- if (m[1]) {
- mhchemParser.concatArray(ret, mhchemParser.go(m[1], 'pu-9,9'));
-
- if (m[2]) {
- if (m[2].match(/[,.]/)) {
- mhchemParser.concatArray(ret, mhchemParser.go(m[2], 'pu-9,9'));
- } else {
- ret.push(m[2]);
- }
- }
-
- m[3] = m[4] || m[3];
-
- if (m[3]) {
- m[3] = m[3].trim();
-
- if (m[3] === "e" || m[3].substr(0, 1) === "*") {
- ret.push({
- type_: 'cdot'
- });
- } else {
- ret.push({
- type_: 'times'
- });
- }
- }
- }
-
- if (m[3]) {
- ret.push("10^{" + m[5] + "}");
- }
-
- return ret;
- },
- 'number^': function number(buffer, m) {
- /** @type {ParserOutput[]} */
- var ret = [];
-
- if (m[0] === "+-" || m[0] === "+/-") {
- ret.push("\\pm ");
- } else if (m[0]) {
- ret.push(m[0]);
- }
-
- mhchemParser.concatArray(ret, mhchemParser.go(m[1], 'pu-9,9'));
- ret.push("^{" + m[2] + "}");
- return ret;
- },
- 'operator': function operator(buffer, m, p1) {
- return {
- type_: 'operator',
- kind_: p1 || m
- };
- },
- 'space': function space() {
- return {
- type_: 'pu-space-1'
- };
- },
- 'output': function output(buffer) {
- /** @type {ParserOutput | ParserOutput[]} */
- var ret;
- var md = mhchemParser.patterns.match_('{(...)}', buffer.d || "");
-
- if (md && md.remainder === '') {
- buffer.d = md.match_;
- }
-
- var mq = mhchemParser.patterns.match_('{(...)}', buffer.q || "");
-
- if (mq && mq.remainder === '') {
- buffer.q = mq.match_;
- }
-
- if (buffer.d) {
- buffer.d = buffer.d.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
- buffer.d = buffer.d.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
- }
-
- if (buffer.q) {
- // fraction
- buffer.q = buffer.q.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
- buffer.q = buffer.q.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
- var b5 = {
- d: mhchemParser.go(buffer.d, 'pu'),
- q: mhchemParser.go(buffer.q, 'pu')
- };
-
- if (buffer.o === '//') {
- ret = {
- type_: 'pu-frac',
- p1: b5.d,
- p2: b5.q
- };
- } else {
- ret = b5.d;
-
- if (b5.d.length > 1 || b5.q.length > 1) {
- ret.push({
- type_: ' / '
- });
- } else {
- ret.push({
- type_: '/'
- });
- }
-
- mhchemParser.concatArray(ret, b5.q);
- }
- } else {
- // no fraction
- ret = mhchemParser.go(buffer.d, 'pu-2');
- }
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- }
- }
- },
- 'pu-2': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '*': {
- action_: 'output'
- }
- },
- '*': {
- '*': {
- action_: ['output', 'cdot'],
- nextState: '0'
- }
- },
- '\\x': {
- '*': {
- action_: 'rm='
- }
- },
- 'space': {
- '*': {
- action_: ['output', 'space'],
- nextState: '0'
- }
- },
- '^{(...)}|^(-1)': {
- '1': {
- action_: '^(-1)'
- }
- },
- '-9.,9': {
- '0': {
- action_: 'rm=',
- nextState: '0'
- },
- '1': {
- action_: '^(-1)',
- nextState: '0'
- }
- },
- '{...}|else': {
- '*': {
- action_: 'rm=',
- nextState: '1'
- }
- }
- }),
- actions: {
- 'cdot': function cdot() {
- return {
- type_: 'tight cdot'
- };
- },
- '^(-1)': function _(buffer, m) {
- buffer.rm += "^{" + m + "}";
- },
- 'space': function space() {
- return {
- type_: 'pu-space-2'
- };
- },
- 'output': function output(buffer) {
- /** @type {ParserOutput | ParserOutput[]} */
- var ret = [];
-
- if (buffer.rm) {
- var mrm = mhchemParser.patterns.match_('{(...)}', buffer.rm || "");
-
- if (mrm && mrm.remainder === '') {
- ret = mhchemParser.go(mrm.match_, 'pu');
- } else {
- ret = {
- type_: 'rm',
- p1: buffer.rm
- };
- }
- }
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- }
- }
- },
- 'pu-9,9': {
- transitions: mhchemParser.createTransitions({
- 'empty': {
- '0': {
- action_: 'output-0'
- },
- 'o': {
- action_: 'output-o'
- }
- },
- ',': {
- '0': {
- action_: ['output-0', 'comma'],
- nextState: 'o'
- }
- },
- '.': {
- '0': {
- action_: ['output-0', 'copy'],
- nextState: 'o'
- }
- },
- 'else': {
- '*': {
- action_: 'text='
- }
- }
- }),
- actions: {
- 'comma': function comma() {
- return {
- type_: 'commaDecimal'
- };
- },
- 'output-0': function output0(buffer) {
- /** @type {ParserOutput[]} */
- var ret = [];
- buffer.text_ = buffer.text_ || "";
-
- if (buffer.text_.length > 4) {
- var a = buffer.text_.length % 3;
-
- if (a === 0) {
- a = 3;
- }
-
- for (var i = buffer.text_.length - 3; i > 0; i -= 3) {
- ret.push(buffer.text_.substr(i, 3));
- ret.push({
- type_: '1000 separator'
- });
- }
-
- ret.push(buffer.text_.substr(0, a));
- ret.reverse();
- } else {
- ret.push(buffer.text_);
- }
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- },
- 'output-o': function outputO(buffer) {
- /** @type {ParserOutput[]} */
- var ret = [];
- buffer.text_ = buffer.text_ || "";
-
- if (buffer.text_.length > 4) {
- var a = buffer.text_.length - 3;
-
- for (var i = 0; i < a; i += 3) {
- ret.push(buffer.text_.substr(i, 3));
- ret.push({
- type_: '1000 separator'
- });
- }
-
- ret.push(buffer.text_.substr(i));
- } else {
- ret.push(buffer.text_);
- }
-
- for (var p in buffer) {
- delete buffer[p];
- }
-
- return ret;
- }
- }
- } //#endregion
-
-}; //
-// texify: Take MhchemParser output and convert it to TeX
-//
-
-/** @type {Texify} */
-
-var texify = {
- go: function go(input, isInner) {
- // (recursive, max 4 levels)
- if (!input) {
- return "";
- }
-
- var res = "";
- var cee = false;
-
- for (var i = 0; i < input.length; i++) {
- var inputi = input[i];
-
- if (typeof inputi === "string") {
- res += inputi;
- } else {
- res += texify._go2(inputi);
-
- if (inputi.type_ === '1st-level escape') {
- cee = true;
- }
- }
- }
-
- if (!isInner && !cee && res) {
- res = "{" + res + "}";
- }
-
- return res;
- },
- _goInner: function _goInner(input) {
- if (!input) {
- return input;
- }
-
- return texify.go(input, true);
- },
- _go2: function _go2(buf) {
- /** @type {undefined | string} */
- var res;
-
- switch (buf.type_) {
- case 'chemfive':
- res = "";
- var b5 = {
- a: texify._goInner(buf.a),
- b: texify._goInner(buf.b),
- p: texify._goInner(buf.p),
- o: texify._goInner(buf.o),
- q: texify._goInner(buf.q),
- d: texify._goInner(buf.d)
- }; //
- // a
- //
-
- if (b5.a) {
- if (b5.a.match(/^[+\-]/)) {
- b5.a = "{" + b5.a + "}";
- }
-
- res += b5.a + "\\,";
- } //
- // b and p
- //
-
-
- if (b5.b || b5.p) {
- res += "{\\vphantom{X}}";
- res += "^{\\hphantom{" + (b5.b || "") + "}}_{\\hphantom{" + (b5.p || "") + "}}";
- res += "{\\vphantom{X}}";
- res += "^{\\smash[t]{\\vphantom{2}}\\mathllap{" + (b5.b || "") + "}}";
- res += "_{\\vphantom{2}\\mathllap{\\smash[t]{" + (b5.p || "") + "}}}";
- } //
- // o
- //
-
-
- if (b5.o) {
- if (b5.o.match(/^[+\-]/)) {
- b5.o = "{" + b5.o + "}";
- }
-
- res += b5.o;
- } //
- // q and d
- //
-
-
- if (buf.dType === 'kv') {
- if (b5.d || b5.q) {
- res += "{\\vphantom{X}}";
- }
-
- if (b5.d) {
- res += "^{" + b5.d + "}";
- }
-
- if (b5.q) {
- res += "_{\\smash[t]{" + b5.q + "}}";
- }
- } else if (buf.dType === 'oxidation') {
- if (b5.d) {
- res += "{\\vphantom{X}}";
- res += "^{" + b5.d + "}";
- }
-
- if (b5.q) {
- res += "{\\vphantom{X}}";
- res += "_{\\smash[t]{" + b5.q + "}}";
- }
- } else {
- if (b5.q) {
- res += "{\\vphantom{X}}";
- res += "_{\\smash[t]{" + b5.q + "}}";
- }
-
- if (b5.d) {
- res += "{\\vphantom{X}}";
- res += "^{" + b5.d + "}";
- }
- }
-
- break;
-
- case 'rm':
- res = "\\mathrm{" + buf.p1 + "}";
- break;
-
- case 'text':
- if (buf.p1.match(/[\^_]/)) {
- buf.p1 = buf.p1.replace(" ", "~").replace("-", "\\text{-}");
- res = "\\mathrm{" + buf.p1 + "}";
- } else {
- res = "\\text{" + buf.p1 + "}";
- }
-
- break;
-
- case 'roman numeral':
- res = "\\mathrm{" + buf.p1 + "}";
- break;
-
- case 'state of aggregation':
- res = "\\mskip2mu " + texify._goInner(buf.p1);
- break;
-
- case 'state of aggregation subscript':
- res = "\\mskip1mu " + texify._goInner(buf.p1);
- break;
-
- case 'bond':
- res = texify._getBond(buf.kind_);
-
- if (!res) {
- throw ["MhchemErrorBond", "mhchem Error. Unknown bond type (" + buf.kind_ + ")"];
- }
-
- break;
-
- case 'frac':
- var c = "\\frac{" + buf.p1 + "}{" + buf.p2 + "}";
- res = "\\mathchoice{\\textstyle" + c + "}{" + c + "}{" + c + "}{" + c + "}";
- break;
-
- case 'pu-frac':
- var d = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
- res = "\\mathchoice{\\textstyle" + d + "}{" + d + "}{" + d + "}{" + d + "}";
- break;
-
- case 'tex-math':
- res = buf.p1 + " ";
- break;
-
- case 'frac-ce':
- res = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
- break;
-
- case 'overset':
- res = "\\overset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
- break;
-
- case 'underset':
- res = "\\underset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
- break;
-
- case 'underbrace':
- res = "\\underbrace{" + texify._goInner(buf.p1) + "}_{" + texify._goInner(buf.p2) + "}";
- break;
-
- case 'color':
- res = "{\\color{" + buf.color1 + "}{" + texify._goInner(buf.color2) + "}}";
- break;
-
- case 'color0':
- res = "\\color{" + buf.color + "}";
- break;
-
- case 'arrow':
- var b6 = {
- rd: texify._goInner(buf.rd),
- rq: texify._goInner(buf.rq)
- };
-
- var arrow = "\\x" + texify._getArrow(buf.r);
-
- if (b6.rq) {
- arrow += "[{" + b6.rq + "}]";
- }
-
- if (b6.rd) {
- arrow += "{" + b6.rd + "}";
- } else {
- arrow += "{}";
- }
-
- res = arrow;
- break;
-
- case 'operator':
- res = texify._getOperator(buf.kind_);
- break;
-
- case '1st-level escape':
- res = buf.p1 + " "; // &, \\\\, \\hlin
-
- break;
-
- case 'space':
- res = " ";
- break;
-
- case 'entitySkip':
- res = "~";
- break;
-
- case 'pu-space-1':
- res = "~";
- break;
-
- case 'pu-space-2':
- res = "\\mkern3mu ";
- break;
-
- case '1000 separator':
- res = "\\mkern2mu ";
- break;
-
- case 'commaDecimal':
- res = "{,}";
- break;
-
- case 'comma enumeration L':
- res = "{" + buf.p1 + "}\\mkern6mu ";
- break;
-
- case 'comma enumeration M':
- res = "{" + buf.p1 + "}\\mkern3mu ";
- break;
-
- case 'comma enumeration S':
- res = "{" + buf.p1 + "}\\mkern1mu ";
- break;
-
- case 'hyphen':
- res = "\\text{-}";
- break;
-
- case 'addition compound':
- res = "\\,{\\cdot}\\,";
- break;
-
- case 'electron dot':
- res = "\\mkern1mu \\bullet\\mkern1mu ";
- break;
-
- case 'KV x':
- res = "{\\times}";
- break;
-
- case 'prime':
- res = "\\prime ";
- break;
-
- case 'cdot':
- res = "\\cdot ";
- break;
-
- case 'tight cdot':
- res = "\\mkern1mu{\\cdot}\\mkern1mu ";
- break;
-
- case 'times':
- res = "\\times ";
- break;
-
- case 'circa':
- res = "{\\sim}";
- break;
-
- case '^':
- res = "uparrow";
- break;
-
- case 'v':
- res = "downarrow";
- break;
-
- case 'ellipsis':
- res = "\\ldots ";
- break;
-
- case '/':
- res = "/";
- break;
-
- case ' / ':
- res = "\\,/\\,";
- break;
-
- default:
- throw ["MhchemBugT", "mhchem bug T. Please report."];
- // Missing texify rule or unknown MhchemParser output
- }
- return res;
- },
- _getArrow: function _getArrow(a) {
- switch (a) {
- case "->":
- return "rightarrow";
-
- case "\u2192":
- return "rightarrow";
-
- case "\u27F6":
- return "rightarrow";
-
- case "<-":
- return "leftarrow";
-
- case "<->":
- return "leftrightarrow";
-
- case "<-->":
- return "rightleftarrows";
-
- case "<=>":
- return "rightleftharpoons";
-
- case "\u21CC":
- return "rightleftharpoons";
-
- case "<=>>":
- return "rightequilibrium";
-
- case "<<=>":
- return "leftequilibrium";
-
- default:
- throw ["MhchemBugT", "mhchem bug T. Please report."];
- }
- },
- _getBond: function _getBond(a) {
- switch (a) {
- case "-":
- return "{-}";
-
- case "1":
- return "{-}";
-
- case "=":
- return "{=}";
-
- case "2":
- return "{=}";
-
- case "#":
- return "{\\equiv}";
-
- case "3":
- return "{\\equiv}";
-
- case "~":
- return "{\\tripledash}";
-
- case "~-":
- return "{\\mathrlap{\\raisebox{-.1em}{$-$}}\\raisebox{.1em}{$\\tripledash$}}";
-
- case "~=":
- return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";
-
- case "~--":
- return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";
-
- case "-~-":
- return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$-$}}\\tripledash}";
-
- case "...":
- return "{{\\cdot}{\\cdot}{\\cdot}}";
-
- case "....":
- return "{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";
-
- case "->":
- return "{\\rightarrow}";
-
- case "<-":
- return "{\\leftarrow}";
-
- case "<":
- return "{<}";
-
- case ">":
- return "{>}";
-
- default:
- throw ["MhchemBugT", "mhchem bug T. Please report."];
- }
- },
- _getOperator: function _getOperator(a) {
- switch (a) {
- case "+":
- return " {}+{} ";
-
- case "-":
- return " {}-{} ";
-
- case "=":
- return " {}={} ";
-
- case "<":
- return " {}<{} ";
-
- case ">":
- return " {}>{} ";
-
- case "<<":
- return " {}\\ll{} ";
-
- case ">>":
- return " {}\\gg{} ";
-
- case "\\pm":
- return " {}\\pm{} ";
-
- case "\\approx":
- return " {}\\approx{} ";
-
- case "$\\approx$":
- return " {}\\approx{} ";
-
- case "v":
- return " \\downarrow{} ";
-
- case "(v)":
- return " \\downarrow{} ";
-
- case "^":
- return " \\uparrow{} ";
-
- case "(^)":
- return " \\uparrow{} ";
-
- default:
- throw ["MhchemBugT", "mhchem bug T. Please report."];
- }
- }
-}; //
diff --git a/javascripts/katex/contrib/render-a11y-string.js b/javascripts/katex/contrib/render-a11y-string.js
deleted file mode 100644
index 7db8452..0000000
--- a/javascripts/katex/contrib/render-a11y-string.js
+++ /dev/null
@@ -1,881 +0,0 @@
-(function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory(require("katex"));
- else if(typeof define === 'function' && define.amd)
- define(["katex"], factory);
- else {
- var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]);
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
- }
-})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__771__) {
-return /******/ (function() { // webpackBootstrap
-/******/ "use strict";
-/******/ var __webpack_modules__ = ({
-
-/***/ 771:
-/***/ (function(module) {
-
-module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/compat get default export */
-/******/ !function() {
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = function(module) {
-/******/ var getter = module && module.__esModule ?
-/******/ function() { return module['default']; } :
-/******/ function() { return module; };
-/******/ __webpack_require__.d(getter, { a: getter });
-/******/ return getter;
-/******/ };
-/******/ }();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ !function() {
-/******/ // define getter functions for harmony exports
-/******/ __webpack_require__.d = function(exports, definition) {
-/******/ for(var key in definition) {
-/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
-/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
-/******/ }
-/******/ }
-/******/ };
-/******/ }();
-/******/
-/******/ /* webpack/runtime/hasOwnProperty shorthand */
-/******/ !function() {
-/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
-/******/ }();
-/******/
-/************************************************************************/
-var __webpack_exports__ = {};
-// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
-!function() {
-/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(771);
-/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__);
-/**
- * renderA11yString returns a readable string.
- *
- * In some cases the string will have the proper semantic math
- * meaning,:
- * renderA11yString("\\frac{1}{2}"")
- * -> "start fraction, 1, divided by, 2, end fraction"
- *
- * However, other cases do not:
- * renderA11yString("f(x) = x^2")
- * -> "f, left parenthesis, x, right parenthesis, equals, x, squared"
- *
- * The commas in the string aim to increase ease of understanding
- * when read by a screenreader.
- */
-// NOTE: since we're importing types here these files won't actually be
-// included in the build.
-// $FlowIgnore: we import the types directly anyways
-
-var stringMap = {
- "(": "left parenthesis",
- ")": "right parenthesis",
- "[": "open bracket",
- "]": "close bracket",
- "\\{": "left brace",
- "\\}": "right brace",
- "\\lvert": "open vertical bar",
- "\\rvert": "close vertical bar",
- "|": "vertical bar",
- "\\uparrow": "up arrow",
- "\\Uparrow": "up arrow",
- "\\downarrow": "down arrow",
- "\\Downarrow": "down arrow",
- "\\updownarrow": "up down arrow",
- "\\leftarrow": "left arrow",
- "\\Leftarrow": "left arrow",
- "\\rightarrow": "right arrow",
- "\\Rightarrow": "right arrow",
- "\\langle": "open angle",
- "\\rangle": "close angle",
- "\\lfloor": "open floor",
- "\\rfloor": "close floor",
- "\\int": "integral",
- "\\intop": "integral",
- "\\lim": "limit",
- "\\ln": "natural log",
- "\\log": "log",
- "\\sin": "sine",
- "\\cos": "cosine",
- "\\tan": "tangent",
- "\\cot": "cotangent",
- "\\sum": "sum",
- "/": "slash",
- ",": "comma",
- ".": "point",
- "-": "negative",
- "+": "plus",
- "~": "tilde",
- ":": "colon",
- "?": "question mark",
- "'": "apostrophe",
- "\\%": "percent",
- " ": "space",
- "\\ ": "space",
- "\\$": "dollar sign",
- "\\angle": "angle",
- "\\degree": "degree",
- "\\circ": "circle",
- "\\vec": "vector",
- "\\triangle": "triangle",
- "\\pi": "pi",
- "\\prime": "prime",
- "\\infty": "infinity",
- "\\alpha": "alpha",
- "\\beta": "beta",
- "\\gamma": "gamma",
- "\\omega": "omega",
- "\\theta": "theta",
- "\\sigma": "sigma",
- "\\lambda": "lambda",
- "\\tau": "tau",
- "\\Delta": "delta",
- "\\delta": "delta",
- "\\mu": "mu",
- "\\rho": "rho",
- "\\nabla": "del",
- "\\ell": "ell",
- "\\ldots": "dots",
- // TODO: add entries for all accents
- "\\hat": "hat",
- "\\acute": "acute"
-};
-var powerMap = {
- "prime": "prime",
- "degree": "degrees",
- "circle": "degrees",
- "2": "squared",
- "3": "cubed"
-};
-var openMap = {
- "|": "open vertical bar",
- ".": ""
-};
-var closeMap = {
- "|": "close vertical bar",
- ".": ""
-};
-var binMap = {
- "+": "plus",
- "-": "minus",
- "\\pm": "plus minus",
- "\\cdot": "dot",
- "*": "times",
- "/": "divided by",
- "\\times": "times",
- "\\div": "divided by",
- "\\circ": "circle",
- "\\bullet": "bullet"
-};
-var relMap = {
- "=": "equals",
- "\\approx": "approximately equals",
- "≠": "does not equal",
- "\\geq": "is greater than or equal to",
- "\\ge": "is greater than or equal to",
- "\\leq": "is less than or equal to",
- "\\le": "is less than or equal to",
- ">": "is greater than",
- "<": "is less than",
- "\\leftarrow": "left arrow",
- "\\Leftarrow": "left arrow",
- "\\rightarrow": "right arrow",
- "\\Rightarrow": "right arrow",
- ":": "colon"
-};
-var accentUnderMap = {
- "\\underleftarrow": "left arrow",
- "\\underrightarrow": "right arrow",
- "\\underleftrightarrow": "left-right arrow",
- "\\undergroup": "group",
- "\\underlinesegment": "line segment",
- "\\utilde": "tilde"
-};
-
-var buildString = function buildString(str, type, a11yStrings) {
- if (!str) {
- return;
- }
-
- var ret;
-
- if (type === "open") {
- ret = str in openMap ? openMap[str] : stringMap[str] || str;
- } else if (type === "close") {
- ret = str in closeMap ? closeMap[str] : stringMap[str] || str;
- } else if (type === "bin") {
- ret = binMap[str] || str;
- } else if (type === "rel") {
- ret = relMap[str] || str;
- } else {
- ret = stringMap[str] || str;
- } // If the text to add is a number and there is already a string
- // in the list and the last string is a number then we should
- // combine them into a single number
-
-
- if (/^\d+$/.test(ret) && a11yStrings.length > 0 && // TODO(kevinb): check that the last item in a11yStrings is a string
- // I think we might be able to drop the nested arrays, which would make
- // this easier to type
- // $FlowFixMe
- /^\d+$/.test(a11yStrings[a11yStrings.length - 1])) {
- a11yStrings[a11yStrings.length - 1] += ret;
- } else if (ret) {
- a11yStrings.push(ret);
- }
-};
-
-var buildRegion = function buildRegion(a11yStrings, callback) {
- var regionStrings = [];
- a11yStrings.push(regionStrings);
- callback(regionStrings);
-};
-
-var handleObject = function handleObject(tree, a11yStrings, atomType) {
- // Everything else is assumed to be an object...
- switch (tree.type) {
- case "accent":
- {
- buildRegion(a11yStrings, function (a11yStrings) {
- buildA11yStrings(tree.base, a11yStrings, atomType);
- a11yStrings.push("with");
- buildString(tree.label, "normal", a11yStrings);
- a11yStrings.push("on top");
- });
- break;
- }
-
- case "accentUnder":
- {
- buildRegion(a11yStrings, function (a11yStrings) {
- buildA11yStrings(tree.base, a11yStrings, atomType);
- a11yStrings.push("with");
- buildString(accentUnderMap[tree.label], "normal", a11yStrings);
- a11yStrings.push("underneath");
- });
- break;
- }
-
- case "accent-token":
- {
- // Used internally by accent symbols.
- break;
- }
-
- case "atom":
- {
- var text = tree.text;
-
- switch (tree.family) {
- case "bin":
- {
- buildString(text, "bin", a11yStrings);
- break;
- }
-
- case "close":
- {
- buildString(text, "close", a11yStrings);
- break;
- }
- // TODO(kevinb): figure out what should be done for inner
-
- case "inner":
- {
- buildString(tree.text, "inner", a11yStrings);
- break;
- }
-
- case "open":
- {
- buildString(text, "open", a11yStrings);
- break;
- }
-
- case "punct":
- {
- buildString(text, "punct", a11yStrings);
- break;
- }
-
- case "rel":
- {
- buildString(text, "rel", a11yStrings);
- break;
- }
-
- default:
- {
- tree.family;
- throw new Error("\"" + tree.family + "\" is not a valid atom type");
- }
- }
-
- break;
- }
-
- case "color":
- {
- var color = tree.color.replace(/katex-/, "");
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start color " + color);
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end color " + color);
- });
- break;
- }
-
- case "color-token":
- {
- // Used by \color, \colorbox, and \fcolorbox but not directly rendered.
- // It's a leaf node and has no children so just break.
- break;
- }
-
- case "delimsizing":
- {
- if (tree.delim && tree.delim !== ".") {
- buildString(tree.delim, "normal", a11yStrings);
- }
-
- break;
- }
-
- case "genfrac":
- {
- buildRegion(a11yStrings, function (regionStrings) {
- // genfrac can have unbalanced delimiters
- var leftDelim = tree.leftDelim,
- rightDelim = tree.rightDelim; // NOTE: Not sure if this is a safe assumption
- // hasBarLine true -> fraction, false -> binomial
-
- if (tree.hasBarLine) {
- regionStrings.push("start fraction");
- leftDelim && buildString(leftDelim, "open", regionStrings);
- buildA11yStrings(tree.numer, regionStrings, atomType);
- regionStrings.push("divided by");
- buildA11yStrings(tree.denom, regionStrings, atomType);
- rightDelim && buildString(rightDelim, "close", regionStrings);
- regionStrings.push("end fraction");
- } else {
- regionStrings.push("start binomial");
- leftDelim && buildString(leftDelim, "open", regionStrings);
- buildA11yStrings(tree.numer, regionStrings, atomType);
- regionStrings.push("over");
- buildA11yStrings(tree.denom, regionStrings, atomType);
- rightDelim && buildString(rightDelim, "close", regionStrings);
- regionStrings.push("end binomial");
- }
- });
- break;
- }
-
- case "hbox":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "kern":
- {
- // No op: we don't attempt to present kerning information
- // to the screen reader.
- break;
- }
-
- case "leftright":
- {
- buildRegion(a11yStrings, function (regionStrings) {
- buildString(tree.left, "open", regionStrings);
- buildA11yStrings(tree.body, regionStrings, atomType);
- buildString(tree.right, "close", regionStrings);
- });
- break;
- }
-
- case "leftright-right":
- {
- // TODO: double check that this is a no-op
- break;
- }
-
- case "lap":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "mathord":
- {
- buildString(tree.text, "normal", a11yStrings);
- break;
- }
-
- case "op":
- {
- var body = tree.body,
- name = tree.name;
-
- if (body) {
- buildA11yStrings(body, a11yStrings, atomType);
- } else if (name) {
- buildString(name, "normal", a11yStrings);
- }
-
- break;
- }
-
- case "op-token":
- {
- // Used internally by operator symbols.
- buildString(tree.text, atomType, a11yStrings);
- break;
- }
-
- case "ordgroup":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "overline":
- {
- buildRegion(a11yStrings, function (a11yStrings) {
- a11yStrings.push("start overline");
- buildA11yStrings(tree.body, a11yStrings, atomType);
- a11yStrings.push("end overline");
- });
- break;
- }
-
- case "pmb":
- {
- a11yStrings.push("bold");
- break;
- }
-
- case "phantom":
- {
- a11yStrings.push("empty space");
- break;
- }
-
- case "raisebox":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "rule":
- {
- a11yStrings.push("rectangle");
- break;
- }
-
- case "sizing":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "spacing":
- {
- a11yStrings.push("space");
- break;
- }
-
- case "styling":
- {
- // We ignore the styling and just pass through the contents
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "sqrt":
- {
- buildRegion(a11yStrings, function (regionStrings) {
- var body = tree.body,
- index = tree.index;
-
- if (index) {
- var indexString = flatten(buildA11yStrings(index, [], atomType)).join(",");
-
- if (indexString === "3") {
- regionStrings.push("cube root of");
- buildA11yStrings(body, regionStrings, atomType);
- regionStrings.push("end cube root");
- return;
- }
-
- regionStrings.push("root");
- regionStrings.push("start index");
- buildA11yStrings(index, regionStrings, atomType);
- regionStrings.push("end index");
- return;
- }
-
- regionStrings.push("square root of");
- buildA11yStrings(body, regionStrings, atomType);
- regionStrings.push("end square root");
- });
- break;
- }
-
- case "supsub":
- {
- var base = tree.base,
- sub = tree.sub,
- sup = tree.sup;
- var isLog = false;
-
- if (base) {
- buildA11yStrings(base, a11yStrings, atomType);
- isLog = base.type === "op" && base.name === "\\log";
- }
-
- if (sub) {
- var regionName = isLog ? "base" : "subscript";
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start " + regionName);
- buildA11yStrings(sub, regionStrings, atomType);
- regionStrings.push("end " + regionName);
- });
- }
-
- if (sup) {
- buildRegion(a11yStrings, function (regionStrings) {
- var supString = flatten(buildA11yStrings(sup, [], atomType)).join(",");
-
- if (supString in powerMap) {
- regionStrings.push(powerMap[supString]);
- return;
- }
-
- regionStrings.push("start superscript");
- buildA11yStrings(sup, regionStrings, atomType);
- regionStrings.push("end superscript");
- });
- }
-
- break;
- }
-
- case "text":
- {
- // TODO: handle other fonts
- if (tree.font === "\\textbf") {
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start bold text");
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end bold text");
- });
- break;
- }
-
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start text");
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end text");
- });
- break;
- }
-
- case "textord":
- {
- buildString(tree.text, atomType, a11yStrings);
- break;
- }
-
- case "smash":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "enclose":
- {
- // TODO: create a map for these.
- // TODO: differentiate between a body with a single atom, e.g.
- // "cancel a" instead of "start cancel, a, end cancel"
- if (/cancel/.test(tree.label)) {
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start cancel");
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end cancel");
- });
- break;
- } else if (/box/.test(tree.label)) {
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start box");
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end box");
- });
- break;
- } else if (/sout/.test(tree.label)) {
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start strikeout");
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end strikeout");
- });
- break;
- } else if (/phase/.test(tree.label)) {
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start phase angle");
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end phase angle");
- });
- break;
- }
-
- throw new Error("KaTeX-a11y: enclose node with " + tree.label + " not supported yet");
- }
-
- case "vcenter":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "vphantom":
- {
- throw new Error("KaTeX-a11y: vphantom not implemented yet");
- }
-
- case "hphantom":
- {
- throw new Error("KaTeX-a11y: hphantom not implemented yet");
- }
-
- case "operatorname":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "array":
- {
- throw new Error("KaTeX-a11y: array not implemented yet");
- }
-
- case "raw":
- {
- throw new Error("KaTeX-a11y: raw not implemented yet");
- }
-
- case "size":
- {
- // Although there are nodes of type "size" in the parse tree, they have
- // no semantic meaning and should be ignored.
- break;
- }
-
- case "url":
- {
- throw new Error("KaTeX-a11y: url not implemented yet");
- }
-
- case "tag":
- {
- throw new Error("KaTeX-a11y: tag not implemented yet");
- }
-
- case "verb":
- {
- buildString("start verbatim", "normal", a11yStrings);
- buildString(tree.body, "normal", a11yStrings);
- buildString("end verbatim", "normal", a11yStrings);
- break;
- }
-
- case "environment":
- {
- throw new Error("KaTeX-a11y: environment not implemented yet");
- }
-
- case "horizBrace":
- {
- buildString("start " + tree.label.slice(1), "normal", a11yStrings);
- buildA11yStrings(tree.base, a11yStrings, atomType);
- buildString("end " + tree.label.slice(1), "normal", a11yStrings);
- break;
- }
-
- case "infix":
- {
- // All infix nodes are replace with other nodes.
- break;
- }
-
- case "includegraphics":
- {
- throw new Error("KaTeX-a11y: includegraphics not implemented yet");
- }
-
- case "font":
- {
- // TODO: callout the start/end of specific fonts
- // TODO: map \BBb{N} to "the naturals" or something like that
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "href":
- {
- throw new Error("KaTeX-a11y: href not implemented yet");
- }
-
- case "cr":
- {
- // This is used by environments.
- throw new Error("KaTeX-a11y: cr not implemented yet");
- }
-
- case "underline":
- {
- buildRegion(a11yStrings, function (a11yStrings) {
- a11yStrings.push("start underline");
- buildA11yStrings(tree.body, a11yStrings, atomType);
- a11yStrings.push("end underline");
- });
- break;
- }
-
- case "xArrow":
- {
- throw new Error("KaTeX-a11y: xArrow not implemented yet");
- }
-
- case "cdlabel":
- {
- throw new Error("KaTeX-a11y: cdlabel not implemented yet");
- }
-
- case "cdlabelparent":
- {
- throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");
- }
-
- case "mclass":
- {
- // \neq and \ne are macros so we let "htmlmathml" render the mathmal
- // side of things and extract the text from that.
- var _atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass
-
-
- buildA11yStrings(tree.body, a11yStrings, _atomType);
- break;
- }
-
- case "mathchoice":
- {
- // TODO: track which style we're using, e.g. display, text, etc.
- // default to text style if even that may not be the correct style
- buildA11yStrings(tree.text, a11yStrings, atomType);
- break;
- }
-
- case "htmlmathml":
- {
- buildA11yStrings(tree.mathml, a11yStrings, atomType);
- break;
- }
-
- case "middle":
- {
- buildString(tree.delim, atomType, a11yStrings);
- break;
- }
-
- case "internal":
- {
- // internal nodes are never included in the parse tree
- break;
- }
-
- case "html":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- default:
- tree.type;
- throw new Error("KaTeX a11y un-recognized type: " + tree.type);
- }
-};
-
-var buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType) {
- if (a11yStrings === void 0) {
- a11yStrings = [];
- }
-
- if (tree instanceof Array) {
- for (var i = 0; i < tree.length; i++) {
- buildA11yStrings(tree[i], a11yStrings, atomType);
- }
- } else {
- handleObject(tree, a11yStrings, atomType);
- }
-
- return a11yStrings;
-};
-
-var flatten = function flatten(array) {
- var result = [];
- array.forEach(function (item) {
- if (item instanceof Array) {
- result = result.concat(flatten(item));
- } else {
- result.push(item);
- }
- });
- return result;
-};
-
-var renderA11yString = function renderA11yString(text, settings) {
- var tree = katex__WEBPACK_IMPORTED_MODULE_0___default().__parse(text, settings);
-
- var a11yStrings = buildA11yStrings(tree, [], "normal");
- return flatten(a11yStrings).join(", ");
-};
-
-/* harmony default export */ __webpack_exports__["default"] = (renderA11yString);
-}();
-__webpack_exports__ = __webpack_exports__["default"];
-/******/ return __webpack_exports__;
-/******/ })()
-;
-});
\ No newline at end of file
diff --git a/javascripts/katex/contrib/render-a11y-string.min.js b/javascripts/katex/contrib/render-a11y-string.min.js
deleted file mode 100644
index 3539b88..0000000
--- a/javascripts/katex/contrib/render-a11y-string.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],r);else{var a="object"==typeof exports?r(require("katex")):r(e.katex);for(var t in a)("object"==typeof exports?exports:e)[t]=a[t]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var r={771:function(r){r.exports=e}},a={};function t(e){var o=a[e];if(void 0!==o)return o.exports;var n=a[e]={exports:{}};return r[e](n,n.exports,t),n.exports}t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,{a:r}),r},t.d=function(e,r){for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)};var o,n,s,i,l,c,u,p,d,h,b,m,f,w,g={};return o=t(771),n=t.n(o),s={"(":"left parenthesis",")":"right parenthesis","[":"open bracket","]":"close bracket","\\{":"left brace","\\}":"right brace","\\lvert":"open vertical bar","\\rvert":"close vertical bar","|":"vertical bar","\\uparrow":"up arrow","\\Uparrow":"up arrow","\\downarrow":"down arrow","\\Downarrow":"down arrow","\\updownarrow":"up down arrow","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow","\\langle":"open angle","\\rangle":"close angle","\\lfloor":"open floor","\\rfloor":"close floor","\\int":"integral","\\intop":"integral","\\lim":"limit","\\ln":"natural log","\\log":"log","\\sin":"sine","\\cos":"cosine","\\tan":"tangent","\\cot":"cotangent","\\sum":"sum","/":"slash",",":"comma",".":"point","-":"negative","+":"plus","~":"tilde",":":"colon","?":"question mark","'":"apostrophe","\\%":"percent"," ":"space","\\ ":"space","\\$":"dollar sign","\\angle":"angle","\\degree":"degree","\\circ":"circle","\\vec":"vector","\\triangle":"triangle","\\pi":"pi","\\prime":"prime","\\infty":"infinity","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\omega":"omega","\\theta":"theta","\\sigma":"sigma","\\lambda":"lambda","\\tau":"tau","\\Delta":"delta","\\delta":"delta","\\mu":"mu","\\rho":"rho","\\nabla":"del","\\ell":"ell","\\ldots":"dots","\\hat":"hat","\\acute":"acute"},i={prime:"prime",degree:"degrees",circle:"degrees",2:"squared",3:"cubed"},l={"|":"open vertical bar",".":""},c={"|":"close vertical bar",".":""},u={"+":"plus","-":"minus","\\pm":"plus minus","\\cdot":"dot","*":"times","/":"divided by","\\times":"times","\\div":"divided by","\\circ":"circle","\\bullet":"bullet"},p={"=":"equals","\\approx":"approximately equals","\u2260":"does not equal","\\geq":"is greater than or equal to","\\ge":"is greater than or equal to","\\leq":"is less than or equal to","\\le":"is less than or equal to",">":"is greater than","<":"is less than","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow",":":"colon"},d={"\\underleftarrow":"left arrow","\\underrightarrow":"right arrow","\\underleftrightarrow":"left-right arrow","\\undergroup":"group","\\underlinesegment":"line segment","\\utilde":"tilde"},h=function(e,r,a){var t;e&&(/^\d+$/.test(t="open"===r?e in l?l[e]:s[e]||e:"close"===r?e in c?c[e]:s[e]||e:"bin"===r?u[e]||e:"rel"===r?p[e]||e:s[e]||e)&&a.length>0&&/^\d+$/.test(a[a.length-1])?a[a.length-1]+=t:t&&a.push(t))},b=function(e,r){var a=[];e.push(a),r(a)},m=function(e,r,a){switch(e.type){case"accent":b(r,(function(r){f(e.base,r,a),r.push("with"),h(e.label,"normal",r),r.push("on top")}));break;case"accentUnder":b(r,(function(r){f(e.base,r,a),r.push("with"),h(d[e.label],"normal",r),r.push("underneath")}));break;case"accent-token":case"color-token":case"kern":case"leftright-right":case"size":case"infix":case"internal":break;case"atom":var t=e.text;switch(e.family){case"bin":h(t,"bin",r);break;case"close":h(t,"close",r);break;case"inner":h(e.text,"inner",r);break;case"open":h(t,"open",r);break;case"punct":h(t,"punct",r);break;case"rel":h(t,"rel",r);break;default:throw e.family,new Error('"'+e.family+'" is not a valid atom type')}break;case"color":var o=e.color.replace(/katex-/,"");b(r,(function(r){r.push("start color "+o),f(e.body,r,a),r.push("end color "+o)}));break;case"delimsizing":e.delim&&"."!==e.delim&&h(e.delim,"normal",r);break;case"genfrac":b(r,(function(r){var t=e.leftDelim,o=e.rightDelim;e.hasBarLine?(r.push("start fraction"),t&&h(t,"open",r),f(e.numer,r,a),r.push("divided by"),f(e.denom,r,a),o&&h(o,"close",r),r.push("end fraction")):(r.push("start binomial"),t&&h(t,"open",r),f(e.numer,r,a),r.push("over"),f(e.denom,r,a),o&&h(o,"close",r),r.push("end binomial"))}));break;case"hbox":case"lap":case"ordgroup":case"raisebox":case"sizing":case"styling":case"smash":case"vcenter":case"operatorname":case"font":case"html":f(e.body,r,a);break;case"leftright":b(r,(function(r){h(e.left,"open",r),f(e.body,r,a),h(e.right,"close",r)}));break;case"mathord":h(e.text,"normal",r);break;case"op":var n=e.body,s=e.name;n?f(n,r,a):s&&h(s,"normal",r);break;case"op-token":case"textord":h(e.text,a,r);break;case"overline":b(r,(function(r){r.push("start overline"),f(e.body,r,a),r.push("end overline")}));break;case"pmb":r.push("bold");break;case"phantom":r.push("empty space");break;case"rule":r.push("rectangle");break;case"spacing":r.push("space");break;case"sqrt":b(r,(function(r){var t=e.body,o=e.index;if(o)return"3"===w(f(o,[],a)).join(",")?(r.push("cube root of"),f(t,r,a),void r.push("end cube root")):(r.push("root"),r.push("start index"),f(o,r,a),void r.push("end index"));r.push("square root of"),f(t,r,a),r.push("end square root")}));break;case"supsub":var l=e.base,c=e.sub,u=e.sup,p=!1;if(l&&(f(l,r,a),p="op"===l.type&&"\\log"===l.name),c){var m=p?"base":"subscript";b(r,(function(e){e.push("start "+m),f(c,e,a),e.push("end "+m)}))}u&&b(r,(function(e){var r=w(f(u,[],a)).join(",");r in i?e.push(i[r]):(e.push("start superscript"),f(u,e,a),e.push("end superscript"))}));break;case"text":if("\\textbf"===e.font){b(r,(function(r){r.push("start bold text"),f(e.body,r,a),r.push("end bold text")}));break}b(r,(function(r){r.push("start text"),f(e.body,r,a),r.push("end text")}));break;case"enclose":if(/cancel/.test(e.label)){b(r,(function(r){r.push("start cancel"),f(e.body,r,a),r.push("end cancel")}));break}if(/box/.test(e.label)){b(r,(function(r){r.push("start box"),f(e.body,r,a),r.push("end box")}));break}if(/sout/.test(e.label)){b(r,(function(r){r.push("start strikeout"),f(e.body,r,a),r.push("end strikeout")}));break}if(/phase/.test(e.label)){b(r,(function(r){r.push("start phase angle"),f(e.body,r,a),r.push("end phase angle")}));break}throw new Error("KaTeX-a11y: enclose node with "+e.label+" not supported yet");case"vphantom":throw new Error("KaTeX-a11y: vphantom not implemented yet");case"hphantom":throw new Error("KaTeX-a11y: hphantom not implemented yet");case"array":throw new Error("KaTeX-a11y: array not implemented yet");case"raw":throw new Error("KaTeX-a11y: raw not implemented yet");case"url":throw new Error("KaTeX-a11y: url not implemented yet");case"tag":throw new Error("KaTeX-a11y: tag not implemented yet");case"verb":h("start verbatim","normal",r),h(e.body,"normal",r),h("end verbatim","normal",r);break;case"environment":throw new Error("KaTeX-a11y: environment not implemented yet");case"horizBrace":h("start "+e.label.slice(1),"normal",r),f(e.base,r,a),h("end "+e.label.slice(1),"normal",r);break;case"includegraphics":throw new Error("KaTeX-a11y: includegraphics not implemented yet");case"href":throw new Error("KaTeX-a11y: href not implemented yet");case"cr":throw new Error("KaTeX-a11y: cr not implemented yet");case"underline":b(r,(function(r){r.push("start underline"),f(e.body,r,a),r.push("end underline")}));break;case"xArrow":throw new Error("KaTeX-a11y: xArrow not implemented yet");case"cdlabel":throw new Error("KaTeX-a11y: cdlabel not implemented yet");case"cdlabelparent":throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");case"mclass":var g=e.mclass.slice(1);f(e.body,r,g);break;case"mathchoice":f(e.text,r,a);break;case"htmlmathml":f(e.mathml,r,a);break;case"middle":h(e.delim,a,r);break;default:throw e.type,new Error("KaTeX a11y un-recognized type: "+e.type)}},f=function e(r,a,t){if(void 0===a&&(a=[]),r instanceof Array)for(var o=0;o "start fraction, 1, divided by, 2, end fraction"
- *
- * However, other cases do not:
- * renderA11yString("f(x) = x^2")
- * -> "f, left parenthesis, x, right parenthesis, equals, x, squared"
- *
- * The commas in the string aim to increase ease of understanding
- * when read by a screenreader.
- */
-var stringMap = {
- "(": "left parenthesis",
- ")": "right parenthesis",
- "[": "open bracket",
- "]": "close bracket",
- "\\{": "left brace",
- "\\}": "right brace",
- "\\lvert": "open vertical bar",
- "\\rvert": "close vertical bar",
- "|": "vertical bar",
- "\\uparrow": "up arrow",
- "\\Uparrow": "up arrow",
- "\\downarrow": "down arrow",
- "\\Downarrow": "down arrow",
- "\\updownarrow": "up down arrow",
- "\\leftarrow": "left arrow",
- "\\Leftarrow": "left arrow",
- "\\rightarrow": "right arrow",
- "\\Rightarrow": "right arrow",
- "\\langle": "open angle",
- "\\rangle": "close angle",
- "\\lfloor": "open floor",
- "\\rfloor": "close floor",
- "\\int": "integral",
- "\\intop": "integral",
- "\\lim": "limit",
- "\\ln": "natural log",
- "\\log": "log",
- "\\sin": "sine",
- "\\cos": "cosine",
- "\\tan": "tangent",
- "\\cot": "cotangent",
- "\\sum": "sum",
- "/": "slash",
- ",": "comma",
- ".": "point",
- "-": "negative",
- "+": "plus",
- "~": "tilde",
- ":": "colon",
- "?": "question mark",
- "'": "apostrophe",
- "\\%": "percent",
- " ": "space",
- "\\ ": "space",
- "\\$": "dollar sign",
- "\\angle": "angle",
- "\\degree": "degree",
- "\\circ": "circle",
- "\\vec": "vector",
- "\\triangle": "triangle",
- "\\pi": "pi",
- "\\prime": "prime",
- "\\infty": "infinity",
- "\\alpha": "alpha",
- "\\beta": "beta",
- "\\gamma": "gamma",
- "\\omega": "omega",
- "\\theta": "theta",
- "\\sigma": "sigma",
- "\\lambda": "lambda",
- "\\tau": "tau",
- "\\Delta": "delta",
- "\\delta": "delta",
- "\\mu": "mu",
- "\\rho": "rho",
- "\\nabla": "del",
- "\\ell": "ell",
- "\\ldots": "dots",
- // TODO: add entries for all accents
- "\\hat": "hat",
- "\\acute": "acute"
-};
-var powerMap = {
- "prime": "prime",
- "degree": "degrees",
- "circle": "degrees",
- "2": "squared",
- "3": "cubed"
-};
-var openMap = {
- "|": "open vertical bar",
- ".": ""
-};
-var closeMap = {
- "|": "close vertical bar",
- ".": ""
-};
-var binMap = {
- "+": "plus",
- "-": "minus",
- "\\pm": "plus minus",
- "\\cdot": "dot",
- "*": "times",
- "/": "divided by",
- "\\times": "times",
- "\\div": "divided by",
- "\\circ": "circle",
- "\\bullet": "bullet"
-};
-var relMap = {
- "=": "equals",
- "\\approx": "approximately equals",
- "≠": "does not equal",
- "\\geq": "is greater than or equal to",
- "\\ge": "is greater than or equal to",
- "\\leq": "is less than or equal to",
- "\\le": "is less than or equal to",
- ">": "is greater than",
- "<": "is less than",
- "\\leftarrow": "left arrow",
- "\\Leftarrow": "left arrow",
- "\\rightarrow": "right arrow",
- "\\Rightarrow": "right arrow",
- ":": "colon"
-};
-var accentUnderMap = {
- "\\underleftarrow": "left arrow",
- "\\underrightarrow": "right arrow",
- "\\underleftrightarrow": "left-right arrow",
- "\\undergroup": "group",
- "\\underlinesegment": "line segment",
- "\\utilde": "tilde"
-};
-
-var buildString = (str, type, a11yStrings) => {
- if (!str) {
- return;
- }
-
- var ret;
-
- if (type === "open") {
- ret = str in openMap ? openMap[str] : stringMap[str] || str;
- } else if (type === "close") {
- ret = str in closeMap ? closeMap[str] : stringMap[str] || str;
- } else if (type === "bin") {
- ret = binMap[str] || str;
- } else if (type === "rel") {
- ret = relMap[str] || str;
- } else {
- ret = stringMap[str] || str;
- } // If the text to add is a number and there is already a string
- // in the list and the last string is a number then we should
- // combine them into a single number
-
-
- if (/^\d+$/.test(ret) && a11yStrings.length > 0 && // TODO(kevinb): check that the last item in a11yStrings is a string
- // I think we might be able to drop the nested arrays, which would make
- // this easier to type
- // $FlowFixMe
- /^\d+$/.test(a11yStrings[a11yStrings.length - 1])) {
- a11yStrings[a11yStrings.length - 1] += ret;
- } else if (ret) {
- a11yStrings.push(ret);
- }
-};
-
-var buildRegion = (a11yStrings, callback) => {
- var regionStrings = [];
- a11yStrings.push(regionStrings);
- callback(regionStrings);
-};
-
-var handleObject = (tree, a11yStrings, atomType) => {
- // Everything else is assumed to be an object...
- switch (tree.type) {
- case "accent":
- {
- buildRegion(a11yStrings, a11yStrings => {
- buildA11yStrings(tree.base, a11yStrings, atomType);
- a11yStrings.push("with");
- buildString(tree.label, "normal", a11yStrings);
- a11yStrings.push("on top");
- });
- break;
- }
-
- case "accentUnder":
- {
- buildRegion(a11yStrings, a11yStrings => {
- buildA11yStrings(tree.base, a11yStrings, atomType);
- a11yStrings.push("with");
- buildString(accentUnderMap[tree.label], "normal", a11yStrings);
- a11yStrings.push("underneath");
- });
- break;
- }
-
- case "accent-token":
- {
- // Used internally by accent symbols.
- break;
- }
-
- case "atom":
- {
- var {
- text
- } = tree;
-
- switch (tree.family) {
- case "bin":
- {
- buildString(text, "bin", a11yStrings);
- break;
- }
-
- case "close":
- {
- buildString(text, "close", a11yStrings);
- break;
- }
- // TODO(kevinb): figure out what should be done for inner
-
- case "inner":
- {
- buildString(tree.text, "inner", a11yStrings);
- break;
- }
-
- case "open":
- {
- buildString(text, "open", a11yStrings);
- break;
- }
-
- case "punct":
- {
- buildString(text, "punct", a11yStrings);
- break;
- }
-
- case "rel":
- {
- buildString(text, "rel", a11yStrings);
- break;
- }
-
- default:
- {
- tree.family;
- throw new Error("\"" + tree.family + "\" is not a valid atom type");
- }
- }
-
- break;
- }
-
- case "color":
- {
- var color = tree.color.replace(/katex-/, "");
- buildRegion(a11yStrings, regionStrings => {
- regionStrings.push("start color " + color);
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end color " + color);
- });
- break;
- }
-
- case "color-token":
- {
- // Used by \color, \colorbox, and \fcolorbox but not directly rendered.
- // It's a leaf node and has no children so just break.
- break;
- }
-
- case "delimsizing":
- {
- if (tree.delim && tree.delim !== ".") {
- buildString(tree.delim, "normal", a11yStrings);
- }
-
- break;
- }
-
- case "genfrac":
- {
- buildRegion(a11yStrings, regionStrings => {
- // genfrac can have unbalanced delimiters
- var {
- leftDelim,
- rightDelim
- } = tree; // NOTE: Not sure if this is a safe assumption
- // hasBarLine true -> fraction, false -> binomial
-
- if (tree.hasBarLine) {
- regionStrings.push("start fraction");
- leftDelim && buildString(leftDelim, "open", regionStrings);
- buildA11yStrings(tree.numer, regionStrings, atomType);
- regionStrings.push("divided by");
- buildA11yStrings(tree.denom, regionStrings, atomType);
- rightDelim && buildString(rightDelim, "close", regionStrings);
- regionStrings.push("end fraction");
- } else {
- regionStrings.push("start binomial");
- leftDelim && buildString(leftDelim, "open", regionStrings);
- buildA11yStrings(tree.numer, regionStrings, atomType);
- regionStrings.push("over");
- buildA11yStrings(tree.denom, regionStrings, atomType);
- rightDelim && buildString(rightDelim, "close", regionStrings);
- regionStrings.push("end binomial");
- }
- });
- break;
- }
-
- case "hbox":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "kern":
- {
- // No op: we don't attempt to present kerning information
- // to the screen reader.
- break;
- }
-
- case "leftright":
- {
- buildRegion(a11yStrings, regionStrings => {
- buildString(tree.left, "open", regionStrings);
- buildA11yStrings(tree.body, regionStrings, atomType);
- buildString(tree.right, "close", regionStrings);
- });
- break;
- }
-
- case "leftright-right":
- {
- // TODO: double check that this is a no-op
- break;
- }
-
- case "lap":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "mathord":
- {
- buildString(tree.text, "normal", a11yStrings);
- break;
- }
-
- case "op":
- {
- var {
- body,
- name
- } = tree;
-
- if (body) {
- buildA11yStrings(body, a11yStrings, atomType);
- } else if (name) {
- buildString(name, "normal", a11yStrings);
- }
-
- break;
- }
-
- case "op-token":
- {
- // Used internally by operator symbols.
- buildString(tree.text, atomType, a11yStrings);
- break;
- }
-
- case "ordgroup":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "overline":
- {
- buildRegion(a11yStrings, function (a11yStrings) {
- a11yStrings.push("start overline");
- buildA11yStrings(tree.body, a11yStrings, atomType);
- a11yStrings.push("end overline");
- });
- break;
- }
-
- case "pmb":
- {
- a11yStrings.push("bold");
- break;
- }
-
- case "phantom":
- {
- a11yStrings.push("empty space");
- break;
- }
-
- case "raisebox":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "rule":
- {
- a11yStrings.push("rectangle");
- break;
- }
-
- case "sizing":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "spacing":
- {
- a11yStrings.push("space");
- break;
- }
-
- case "styling":
- {
- // We ignore the styling and just pass through the contents
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "sqrt":
- {
- buildRegion(a11yStrings, regionStrings => {
- var {
- body,
- index
- } = tree;
-
- if (index) {
- var indexString = flatten(buildA11yStrings(index, [], atomType)).join(",");
-
- if (indexString === "3") {
- regionStrings.push("cube root of");
- buildA11yStrings(body, regionStrings, atomType);
- regionStrings.push("end cube root");
- return;
- }
-
- regionStrings.push("root");
- regionStrings.push("start index");
- buildA11yStrings(index, regionStrings, atomType);
- regionStrings.push("end index");
- return;
- }
-
- regionStrings.push("square root of");
- buildA11yStrings(body, regionStrings, atomType);
- regionStrings.push("end square root");
- });
- break;
- }
-
- case "supsub":
- {
- var {
- base,
- sub,
- sup
- } = tree;
- var isLog = false;
-
- if (base) {
- buildA11yStrings(base, a11yStrings, atomType);
- isLog = base.type === "op" && base.name === "\\log";
- }
-
- if (sub) {
- var regionName = isLog ? "base" : "subscript";
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start " + regionName);
- buildA11yStrings(sub, regionStrings, atomType);
- regionStrings.push("end " + regionName);
- });
- }
-
- if (sup) {
- buildRegion(a11yStrings, function (regionStrings) {
- var supString = flatten(buildA11yStrings(sup, [], atomType)).join(",");
-
- if (supString in powerMap) {
- regionStrings.push(powerMap[supString]);
- return;
- }
-
- regionStrings.push("start superscript");
- buildA11yStrings(sup, regionStrings, atomType);
- regionStrings.push("end superscript");
- });
- }
-
- break;
- }
-
- case "text":
- {
- // TODO: handle other fonts
- if (tree.font === "\\textbf") {
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start bold text");
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end bold text");
- });
- break;
- }
-
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start text");
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end text");
- });
- break;
- }
-
- case "textord":
- {
- buildString(tree.text, atomType, a11yStrings);
- break;
- }
-
- case "smash":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "enclose":
- {
- // TODO: create a map for these.
- // TODO: differentiate between a body with a single atom, e.g.
- // "cancel a" instead of "start cancel, a, end cancel"
- if (/cancel/.test(tree.label)) {
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start cancel");
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end cancel");
- });
- break;
- } else if (/box/.test(tree.label)) {
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start box");
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end box");
- });
- break;
- } else if (/sout/.test(tree.label)) {
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start strikeout");
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end strikeout");
- });
- break;
- } else if (/phase/.test(tree.label)) {
- buildRegion(a11yStrings, function (regionStrings) {
- regionStrings.push("start phase angle");
- buildA11yStrings(tree.body, regionStrings, atomType);
- regionStrings.push("end phase angle");
- });
- break;
- }
-
- throw new Error("KaTeX-a11y: enclose node with " + tree.label + " not supported yet");
- }
-
- case "vcenter":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "vphantom":
- {
- throw new Error("KaTeX-a11y: vphantom not implemented yet");
- }
-
- case "hphantom":
- {
- throw new Error("KaTeX-a11y: hphantom not implemented yet");
- }
-
- case "operatorname":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "array":
- {
- throw new Error("KaTeX-a11y: array not implemented yet");
- }
-
- case "raw":
- {
- throw new Error("KaTeX-a11y: raw not implemented yet");
- }
-
- case "size":
- {
- // Although there are nodes of type "size" in the parse tree, they have
- // no semantic meaning and should be ignored.
- break;
- }
-
- case "url":
- {
- throw new Error("KaTeX-a11y: url not implemented yet");
- }
-
- case "tag":
- {
- throw new Error("KaTeX-a11y: tag not implemented yet");
- }
-
- case "verb":
- {
- buildString("start verbatim", "normal", a11yStrings);
- buildString(tree.body, "normal", a11yStrings);
- buildString("end verbatim", "normal", a11yStrings);
- break;
- }
-
- case "environment":
- {
- throw new Error("KaTeX-a11y: environment not implemented yet");
- }
-
- case "horizBrace":
- {
- buildString("start " + tree.label.slice(1), "normal", a11yStrings);
- buildA11yStrings(tree.base, a11yStrings, atomType);
- buildString("end " + tree.label.slice(1), "normal", a11yStrings);
- break;
- }
-
- case "infix":
- {
- // All infix nodes are replace with other nodes.
- break;
- }
-
- case "includegraphics":
- {
- throw new Error("KaTeX-a11y: includegraphics not implemented yet");
- }
-
- case "font":
- {
- // TODO: callout the start/end of specific fonts
- // TODO: map \BBb{N} to "the naturals" or something like that
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- case "href":
- {
- throw new Error("KaTeX-a11y: href not implemented yet");
- }
-
- case "cr":
- {
- // This is used by environments.
- throw new Error("KaTeX-a11y: cr not implemented yet");
- }
-
- case "underline":
- {
- buildRegion(a11yStrings, function (a11yStrings) {
- a11yStrings.push("start underline");
- buildA11yStrings(tree.body, a11yStrings, atomType);
- a11yStrings.push("end underline");
- });
- break;
- }
-
- case "xArrow":
- {
- throw new Error("KaTeX-a11y: xArrow not implemented yet");
- }
-
- case "cdlabel":
- {
- throw new Error("KaTeX-a11y: cdlabel not implemented yet");
- }
-
- case "cdlabelparent":
- {
- throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");
- }
-
- case "mclass":
- {
- // \neq and \ne are macros so we let "htmlmathml" render the mathmal
- // side of things and extract the text from that.
- var _atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass
-
-
- buildA11yStrings(tree.body, a11yStrings, _atomType);
- break;
- }
-
- case "mathchoice":
- {
- // TODO: track which style we're using, e.g. display, text, etc.
- // default to text style if even that may not be the correct style
- buildA11yStrings(tree.text, a11yStrings, atomType);
- break;
- }
-
- case "htmlmathml":
- {
- buildA11yStrings(tree.mathml, a11yStrings, atomType);
- break;
- }
-
- case "middle":
- {
- buildString(tree.delim, atomType, a11yStrings);
- break;
- }
-
- case "internal":
- {
- // internal nodes are never included in the parse tree
- break;
- }
-
- case "html":
- {
- buildA11yStrings(tree.body, a11yStrings, atomType);
- break;
- }
-
- default:
- tree.type;
- throw new Error("KaTeX a11y un-recognized type: " + tree.type);
- }
-};
-
-var buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType) {
- if (a11yStrings === void 0) {
- a11yStrings = [];
- }
-
- if (tree instanceof Array) {
- for (var i = 0; i < tree.length; i++) {
- buildA11yStrings(tree[i], a11yStrings, atomType);
- }
- } else {
- handleObject(tree, a11yStrings, atomType);
- }
-
- return a11yStrings;
-};
-
-var flatten = function flatten(array) {
- var result = [];
- array.forEach(function (item) {
- if (item instanceof Array) {
- result = result.concat(flatten(item));
- } else {
- result.push(item);
- }
- });
- return result;
-};
-
-var renderA11yString = function renderA11yString(text, settings) {
- var tree = katex.__parse(text, settings);
-
- var a11yStrings = buildA11yStrings(tree, [], "normal");
- return flatten(a11yStrings).join(", ");
-};
-
-export { renderA11yString as default };
diff --git a/javascripts/katex/fonts/KaTeX_AMS-Regular.ttf b/javascripts/katex/fonts/KaTeX_AMS-Regular.ttf
deleted file mode 100644
index c6f9a5e7c03f9e64e9c7b4773a8e37ade8eaf406..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 63632
zcmbrn2Y_5vy+1zZ+}>v9PA|K&Q+8*zm#LfW$)@jadhd`*Ab^yRkN_cst`re8fFO26
z#RAAr;bDJIeHH}8=ksBCzJ@$SAHF|-WoQ4NbM9;*28G{0lVoS^y>st5-}3p^bJj&%
zE|=SN!X>zNtz6rcUwmSDhs*VoZ8*AX_n~tx{`1$L`aC{A<#Gw@b|1bhseDj*%;kFN
z>p0)N@8bQ3&h7m3F_-ISUfjgof6k>B<2c^Gb`yT8`!6`U@ARI3`V!v1>~j6!r2~7<
z*|Re}iYGoV;#m0r4v0%s5ANTK&y5ETU3TQBzs}@wegMz=(*+mpKIa|(@8F9r*R!v=
zTvR`F&XJ4B7u_%5^G|Sn^1^ct?cM&RvwxxE-iKO
zC3`R4yYSQZ<9r>i|Co!qaBtT?&>&{3xLgIhVCM>UCV$VKe4Yj;f0HMlb%|{J^cnj1
zu71~Q*A~|vmo=jA*t&Mj@}X`j=G&SAN+zAlR?3BZxm+k$O2u3*6O7zl;&!aJPC
zdH(WM%HfdD$4(UTpT$Krh0--=4C>3!8bX0<1N~Or&vqvb3
z90H$kKR>@9#}8J@Wr;B%o5=*jp@8t%Ga*6Wm-h9y7*=tKPKj~h=EUbeLoJgihSaQT
zln@~plLg68h{YojyW|NWG((uC}qDBHCjGEf$mqR=Pzz#>68i*hrG)1#8FGE~q3)
z(7s{Mi`WLosm>6yF2w;)7kOzgB
zc!$6hnaMhc3)b*sILsuuTq>6FhO<#lvkM#sFiuv=jzr^hm~o1IwMou^_~9RaC8`cy
zoHA6+5|qyKZdx&a%|Va6aox>siFoDS;jSjjXShX)5J_}vRJ1k~n^Tcc=X^`eOGIgS
z;G2R>sVMEr1<46_*zzcKWPSBpMD1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