Socket
Socket
Sign inDemoInstall

katex

Package Overview
Dependencies
Maintainers
7
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

katex - npm Package Compare versions

Comparing version 0.16.9 to 0.16.10

4

contrib/copy-tex/README.md

@@ -21,3 +21,3 @@ # Copy-tex extension

```html
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/copy-tex.min.js" integrity="sha384-ww/583aHhxWkz5DEVn6OKtNiIaLi2iBRNZXfJRiY1Ai7tnJ9UXpEsyvOITVpTl4A" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/copy-tex.min.js" integrity="sha384-HORx6nWi8j5/mYA+y57/9/CZc5z8HnEw4WUZWy5yOn9ToKBv1l58vJaufFAn9Zzi" crossorigin="anonymous"></script>
```

@@ -39,3 +39,3 @@

```html
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/copy-tex.mjs" integrity="sha384-bVEnwt0PtX+1EuJoOEcm4rgTUWvb2ILTdjHfI1gUe/r5fdqrTcQaUuRdHG2DciuQ" crossorigin="anonymous"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/copy-tex.mjs" integrity="sha384-bVEnwt0PtX+1EuJoOEcm4rgTUWvb2ILTdjHfI1gUe/r5fdqrTcQaUuRdHG2DciuQ" crossorigin="anonymous"></script>
```

@@ -14,3 +14,3 @@ # `math/tex` Custom Script Type Extension

```html
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/mathtex-script-type.min.js" integrity="sha384-jiBVvJ8NGGj5n7kJaiWwWp9AjC+Yh8rhZY3GtAX8yU28azcLgoRo4oukO87g7zDT" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/mathtex-script-type.min.js" integrity="sha384-OGHJvxKrLNowXjZcg7A8ziPZctl4h7FncefPoKSuxgVXFxeM87GCKFJvOaTeBB9q" crossorigin="anonymous"></script>
```

@@ -27,5 +27,5 @@ You can download the script and use it locally, or from a local KaTeX installation instead.

<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/mathtex-script-type.min.js" integrity="sha384-jiBVvJ8NGGj5n7kJaiWwWp9AjC+Yh8rhZY3GtAX8yU28azcLgoRo4oukO87g7zDT" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.css" integrity="sha384-wcIxkf4k558AjM3Yz3BBFQUbk/zgIYC2R0QpeeYb+TwlBVMrlgLqwRjRtGZiK7ww" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.js" integrity="sha384-hIoBPJpTUs74ddyc4bFZSM1TVlQDA60VBbJS0oA934VSz82sBx1X7kSx2ATBDIyd" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/mathtex-script-type.min.js" integrity="sha384-OGHJvxKrLNowXjZcg7A8ziPZctl4h7FncefPoKSuxgVXFxeM87GCKFJvOaTeBB9q" crossorigin="anonymous"></script>
</head>

@@ -40,2 +40,2 @@ <body>

```html
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/mathtex-script-type.mjs" integrity="sha384-4EJvC5tvqq9XJxXvdD4JutBokuFw/dCe2AB4gZ9sRpwFFXECpL3qT43tmE0PkpVg" crossorigin="anonymous"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/mathtex-script-type.mjs" integrity="sha384-4EJvC5tvqq9XJxXvdD4JutBokuFw/dCe2AB4gZ9sRpwFFXECpL3qT43tmE0PkpVg" crossorigin="anonymous"></script>

@@ -10,3 +10,3 @@ # mhchem extension

```html
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/mhchem.min.js" integrity="sha384-ifpG+NlgMq0kvOSGqGQxW1mJKpjjMDmZdpKGq3tbvD3WPhyshCEEYClriK/wRVU0" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/mhchem.min.js" integrity="sha384-ifpG+NlgMq0kvOSGqGQxW1mJKpjjMDmZdpKGq3tbvD3WPhyshCEEYClriK/wRVU0" crossorigin="anonymous"></script>
```

@@ -13,0 +13,0 @@

@@ -93,11 +93,11 @@ (function webpackUniversalModuleDefinition(root, factory) {

/* eslint no-constant-condition:0 */
var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) {
const findEndOfMath = function (delimiter, text, startIndex) {
// Adapted from
// https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
var index = startIndex;
var braceLevel = 0;
var delimLength = delimiter.length;
let index = startIndex;
let braceLevel = 0;
const delimLength = delimiter.length;
while (index < text.length) {
var character = text[index];
const character = text[index];

@@ -120,14 +120,12 @@ if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) {

var escapeRegex = function escapeRegex(string) {
const escapeRegex = function (string) {
return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
};
var amsRegex = /^\\begin{/;
const amsRegex = /^\\begin{/;
var splitAtDelimiters = function splitAtDelimiters(text, delimiters) {
var index;
var data = [];
var regexLeft = new RegExp("(" + delimiters.map(function (x) {
return escapeRegex(x.left);
}).join("|") + ")");
const splitAtDelimiters = function (text, delimiters) {
let index;
const data = [];
const regexLeft = new RegExp("(" + delimiters.map(x => escapeRegex(x.left)).join("|") + ")");

@@ -150,5 +148,3 @@ while (true) {

var i = delimiters.findIndex(function (delim) {
return text.startsWith(delim.left);
});
const i = delimiters.findIndex(delim => text.startsWith(delim.left));
index = findEndOfMath(delimiters[i].right, text, delimiters[i].left.length);

@@ -160,8 +156,8 @@

var rawData = text.slice(0, index + delimiters[i].right.length);
var math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index);
const rawData = text.slice(0, index + delimiters[i].right.length);
const math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index);
data.push({
type: "math",
data: math,
rawData: rawData,
rawData,
display: delimiters[i].display

@@ -191,4 +187,4 @@ });

var renderMathInText = function renderMathInText(text, optionsCopy) {
var data = auto_render_splitAtDelimiters(text, optionsCopy.delimiters);
const renderMathInText = function (text, optionsCopy) {
const data = auto_render_splitAtDelimiters(text, optionsCopy.delimiters);

@@ -202,10 +198,10 @@ if (data.length === 1 && data[0].type === 'text') {

var fragment = document.createDocumentFragment();
const fragment = document.createDocumentFragment();
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
if (data[i].type === "text") {
fragment.appendChild(document.createTextNode(data[i].data));
} else {
var span = document.createElement("span");
var math = data[i].data; // Override any display mode defined in the settings with that
const span = document.createElement("span");
let math = data[i].data; // Override any display mode defined in the settings with that
// defined by the text itself

@@ -238,5 +234,5 @@

var renderElem = function renderElem(elem, optionsCopy) {
for (var i = 0; i < elem.childNodes.length; i++) {
var childNode = elem.childNodes[i];
const renderElem = function (elem, optionsCopy) {
for (let i = 0; i < elem.childNodes.length; i++) {
const childNode = elem.childNodes[i];

@@ -248,5 +244,5 @@ if (childNode.nodeType === 3) {

// so the delimiters may be split across different nodes.
var textContentConcat = childNode.textContent;
var sibling = childNode.nextSibling;
var nSiblings = 0;
let textContentConcat = childNode.textContent;
let sibling = childNode.nextSibling;
let nSiblings = 0;

@@ -259,7 +255,7 @@ while (sibling && sibling.nodeType === Node.TEXT_NODE) {

var frag = renderMathInText(textContentConcat, optionsCopy);
const frag = renderMathInText(textContentConcat, optionsCopy);
if (frag) {
// Remove extra text nodes
for (var j = 0; j < nSiblings; j++) {
for (let j = 0; j < nSiblings; j++) {
childNode.nextSibling.remove();

@@ -276,13 +272,9 @@ }

} else if (childNode.nodeType === 1) {
(function () {
// Element node
var className = ' ' + childNode.className + ' ';
var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(function (x) {
return className.indexOf(' ' + x + ' ') === -1;
});
// Element node
const className = ' ' + childNode.className + ' ';
const shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(x => className.indexOf(' ' + x + ' ') === -1);
if (shouldRender) {
renderElem(childNode, optionsCopy);
}
})();
if (shouldRender) {
renderElem(childNode, optionsCopy);
}
} // Otherwise, it's something else, and ignore it.

@@ -293,3 +285,3 @@

var renderMathInElement = function renderMathInElement(elem, options) {
const renderMathInElement = function (elem, options) {
if (!elem) {

@@ -299,5 +291,5 @@ throw new Error("No element provided to render");

var optionsCopy = {}; // Object.assign(optionsCopy, option)
const optionsCopy = {}; // Object.assign(optionsCopy, option)
for (var option in options) {
for (const option in options) {
if (options.hasOwnProperty(option)) {

@@ -304,0 +296,0 @@ optionsCopy[option] = options[option];

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.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 i={};return function(){n.d(i,{default:function(){return s}});var e=n(771),t=n.n(e),r=function(e,t,r){for(var n=r,i=0,a=e.length;n<t.length;){var o=t[n];if(i<=0&&t.slice(n,n+a)===e)return n;"\\"===o?n++:"{"===o?i++:"}"===o&&i--,n++}return-1},a=/^\\begin{/,o=function(e,t){for(var n,i=[],o=new RegExp("("+t.map((function(e){return e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")})).join("|")+")");-1!==(n=e.search(o));){n>0&&(i.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));var l=t.findIndex((function(t){return e.startsWith(t.left)}));if(-1===(n=r(t[l].right,e,t[l].left.length)))break;var d=e.slice(0,n+t[l].right.length),s=a.test(d)?d:e.slice(t[l].left.length,n);i.push({type:"math",data:s,rawData:d,display:t[l].display}),e=e.slice(n+t[l].right.length)}return""!==e&&i.push({type:"text",data:e}),i},l=function(e,r){var n=o(e,r.delimiters);if(1===n.length&&"text"===n[0].type)return null;for(var i=document.createDocumentFragment(),a=0;a<n.length;a++)if("text"===n[a].type)i.appendChild(document.createTextNode(n[a].data));else{var l=document.createElement("span"),d=n[a].data;r.displayMode=n[a].display;try{r.preProcess&&(d=r.preProcess(d)),t().render(d,l,r)}catch(e){if(!(e instanceof t().ParseError))throw e;r.errorCallback("KaTeX auto-render: Failed to parse `"+n[a].data+"` with ",e),i.appendChild(document.createTextNode(n[a].rawData));continue}i.appendChild(l)}return i},d=function e(t,r){for(var n=0;n<t.childNodes.length;n++){var i=t.childNodes[n];if(3===i.nodeType){for(var a=i.textContent,o=i.nextSibling,d=0;o&&o.nodeType===Node.TEXT_NODE;)a+=o.textContent,o=o.nextSibling,d++;var s=l(a,r);if(s){for(var f=0;f<d;f++)i.nextSibling.remove();n+=s.childNodes.length-1,t.replaceChild(s,i)}else n+=d}else 1===i.nodeType&&function(){var t=" "+i.className+" ";-1===r.ignoredTags.indexOf(i.nodeName.toLowerCase())&&r.ignoredClasses.every((function(e){return-1===t.indexOf(" "+e+" ")}))&&e(i,r)}()}},s=function(e,t){if(!e)throw new Error("No element provided to render");var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.delimiters=r.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code","option"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},d(e,r)}}(),i=i.default}()}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){r.d(o,{default:function(){return d}});var e=r(771),t=r.n(e);const n=function(e,t,n){let r=n,o=0;const i=e.length;for(;r<t.length;){const n=t[r];if(o<=0&&t.slice(r,r+i)===e)return r;"\\"===n?r++:"{"===n?o++:"}"===n&&o--,r++}return-1},i=/^\\begin{/;var a=function(e,t){let r;const o=[],a=new RegExp("("+t.map((e=>e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|")+")");for(;r=e.search(a),-1!==r;){r>0&&(o.push({type:"text",data:e.slice(0,r)}),e=e.slice(r));const a=t.findIndex((t=>e.startsWith(t.left)));if(r=n(t[a].right,e,t[a].left.length),-1===r)break;const l=e.slice(0,r+t[a].right.length),s=i.test(l)?l:e.slice(t[a].left.length,r);o.push({type:"math",data:s,rawData:l,display:t[a].display}),e=e.slice(r+t[a].right.length)}return""!==e&&o.push({type:"text",data:e}),o};const l=function(e,n){const r=a(e,n.delimiters);if(1===r.length&&"text"===r[0].type)return null;const o=document.createDocumentFragment();for(let e=0;e<r.length;e++)if("text"===r[e].type)o.appendChild(document.createTextNode(r[e].data));else{const i=document.createElement("span");let a=r[e].data;n.displayMode=r[e].display;try{n.preProcess&&(a=n.preProcess(a)),t().render(a,i,n)}catch(i){if(!(i instanceof t().ParseError))throw i;n.errorCallback("KaTeX auto-render: Failed to parse `"+r[e].data+"` with ",i),o.appendChild(document.createTextNode(r[e].rawData));continue}o.appendChild(i)}return o},s=function(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(3===r.nodeType){let o=r.textContent,i=r.nextSibling,a=0;for(;i&&i.nodeType===Node.TEXT_NODE;)o+=i.textContent,i=i.nextSibling,a++;const s=l(o,t);if(s){for(let e=0;e<a;e++)r.nextSibling.remove();n+=s.childNodes.length-1,e.replaceChild(s,r)}else n+=a}else if(1===r.nodeType){const e=" "+r.className+" ";-1===t.ignoredTags.indexOf(r.nodeName.toLowerCase())&&t.ignoredClasses.every((t=>-1===e.indexOf(" "+t+" ")))&&s(r,t)}}};var d=function(e,t){if(!e)throw new Error("No element provided to render");const n={};for(const e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=n.ignoredTags||["script","noscript","style","textarea","pre","code","option"],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},s(e,n)}}(),o=o.default}()}));

@@ -17,3 +17,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

// Set these to how you want inline and display math to be delimited.
var defaultCopyDelimiters = {
const defaultCopyDelimiters = {
inline: ['$', '$'],

@@ -34,6 +34,6 @@ // alternative: ['\(', '\)']

// (which will get replaced below).
var katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html');
const katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html');
for (var i = 0; i < katexHtml.length; i++) {
var element = katexHtml[i];
for (let i = 0; i < katexHtml.length; i++) {
const element = katexHtml[i];

@@ -49,14 +49,13 @@ if (element.remove) {

var katexMathml = fragment.querySelectorAll('.katex-mathml');
const katexMathml = fragment.querySelectorAll('.katex-mathml');
for (var _i = 0; _i < katexMathml.length; _i++) {
var _element = katexMathml[_i];
for (let i = 0; i < katexMathml.length; i++) {
const element = katexMathml[i];
const texSource = element.querySelector('annotation');
var texSource = _element.querySelector('annotation');
if (texSource) {
if (_element.replaceWith) {
_element.replaceWith(texSource);
} else if (_element.parentNode) {
_element.parentNode.replaceChild(texSource, _element);
if (element.replaceWith) {
element.replaceWith(texSource);
} else if (element.parentNode) {
element.parentNode.replaceChild(texSource, element);
}

@@ -69,7 +68,7 @@

var displays = fragment.querySelectorAll('.katex-display annotation');
const 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];
for (let i = 0; i < displays.length; i++) {
const element = displays[i];
element.innerHTML = copyDelimiters.display[0] + element.innerHTML.substr(copyDelimiters.inline[0].length, element.innerHTML.length - copyDelimiters.inline[0].length - copyDelimiters.inline[1].length) + copyDelimiters.display[1];
}

@@ -86,3 +85,3 @@

// where we can apply the `closest` method.
var element = node instanceof Element ? node : node.parentElement;
const element = node instanceof Element ? node : node.parentElement;
return element && element.closest('.katex');

@@ -93,3 +92,3 @@ } // Global copy handler to modify behavior on/within .katex elements.

document.addEventListener('copy', function (event) {
var selection = window.getSelection();
const selection = window.getSelection();

@@ -100,6 +99,6 @@ if (selection.isCollapsed || !event.clipboardData) {

var clipboardData = event.clipboardData;
var range = selection.getRangeAt(0); // When start point is within a formula, expand to entire formula.
const clipboardData = event.clipboardData;
const range = selection.getRangeAt(0); // When start point is within a formula, expand to entire formula.
var startKatex = closestKatex(range.startContainer);
const startKatex = closestKatex(range.startContainer);

@@ -111,3 +110,3 @@ if (startKatex) {

var endKatex = closestKatex(range.endContainer);
const endKatex = closestKatex(range.endContainer);

@@ -118,3 +117,3 @@ if (endKatex) {

var fragment = range.cloneContents();
const fragment = range.cloneContents();

@@ -125,5 +124,3 @@ if (!fragment.querySelector('.katex-mathml')) {

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.
const htmlContents = Array.prototype.map.call(fragment.childNodes, el => el instanceof Text ? el.textContent : el.outerHTML).join(''); // Preserve usual HTML copy/paste behavior.

@@ -130,0 +127,0 @@ clipboardData.setData('text/html', htmlContents); // Rewrite plain-text version.

@@ -1,1 +0,1 @@

!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<r.length;a++){var o=r[a];o.remove?o.remove():o.parentNode&&o.parentNode.removeChild(o)}for(var i=e.querySelectorAll(".katex-mathml"),l=0;l<i.length;l++){var f=i[l],c=f.querySelector("annotation");c&&(f.replaceWith?f.replaceWith(c):f.parentNode&&f.parentNode.replaceChild(c,f),c.innerHTML=n.inline[0]+c.innerHTML+n.inline[1])}for(var d=e.querySelectorAll(".katex-display annotation"),s=0;s<d.length;s++){var p=d[s];p.innerHTML=n.display[0]+p.innerHTML.substr(n.inline[0].length,p.innerHTML.length-n.inline[0].length-n.inline[1].length)+n.display[1]}return e};function r(e){var t=e instanceof Element?e:e.parentElement;return t&&t.closest(".katex")}return document.addEventListener("copy",(function(e){var t=window.getSelection();if(!t.isCollapsed&&e.clipboardData){var a=e.clipboardData,o=t.getRangeAt(0),i=r(o.startContainer);i&&o.setStartBefore(i);var l=r(o.endContainer);l&&o.setEndAfter(l);var f=o.cloneContents();if(f.querySelector(".katex-mathml")){var c=Array.prototype.map.call(f.childNodes,(function(e){return e instanceof Text?e.textContent:e.outerHTML})).join("");a.setData("text/html",c),a.setData("text/plain",n(f).textContent),e.preventDefault()}}})),e=e.default}()}));
!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 o in n)("object"==typeof exports?exports:e)[o]=n[o]}}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={};const t={inline:["$","$"],display:["$$","$$"]};var n=function(e,n){void 0===n&&(n=t);const o=e.querySelectorAll(".katex-mathml + .katex-html");for(let e=0;e<o.length;e++){const t=o[e];t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}const r=e.querySelectorAll(".katex-mathml");for(let e=0;e<r.length;e++){const t=r[e],o=t.querySelector("annotation");o&&(t.replaceWith?t.replaceWith(o):t.parentNode&&t.parentNode.replaceChild(o,t),o.innerHTML=n.inline[0]+o.innerHTML+n.inline[1])}const l=e.querySelectorAll(".katex-display annotation");for(let e=0;e<l.length;e++){const t=l[e];t.innerHTML=n.display[0]+t.innerHTML.substr(n.inline[0].length,t.innerHTML.length-n.inline[0].length-n.inline[1].length)+n.display[1]}return e};function o(e){const t=e instanceof Element?e:e.parentElement;return t&&t.closest(".katex")}return document.addEventListener("copy",(function(e){const t=window.getSelection();if(t.isCollapsed||!e.clipboardData)return;const r=e.clipboardData,l=t.getRangeAt(0),i=o(l.startContainer);i&&l.setStartBefore(i);const a=o(l.endContainer);a&&l.setEndAfter(a);const s=l.cloneContents();if(!s.querySelector(".katex-mathml"))return;const c=Array.prototype.map.call(s.childNodes,(e=>e instanceof Text?e.textContent:e.outerHTML)).join("");r.setData("text/html",c),r.setData("text/plain",n(s).textContent),e.preventDefault()})),e=e.default}()}));

@@ -85,3 +85,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

var scripts = document.body.getElementsByTagName("script");
let scripts = document.body.getElementsByTagName("script");
scripts = Array.prototype.slice.call(scripts);

@@ -93,4 +93,4 @@ scripts.forEach(function (script) {

var display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null;
var katexElement = document.createElement(display ? "div" : "span");
const display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null;
const katexElement = document.createElement(display ? "div" : "span");
katexElement.setAttribute("class", display ? "equation" : "inline-equation");

@@ -97,0 +97,0 @@

@@ -1,1 +0,1 @@

!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}()}));
!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 n="object"==typeof exports?t(require("katex")):t(e.katex);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){var e=r(771),t=r.n(e);let n=document.body.getElementsByTagName("script");n=Array.prototype.slice.call(n),n.forEach((function(e){if(!e.type||!e.type.match(/math\/tex/i))return-1;const n=null!=e.type.match(/mode\s*=\s*display(;|\s|\n|$)/),r=document.createElement(n?"div":"span");r.setAttribute("class",n?"equation":"inline-equation");try{t().render(e.text,r,{displayMode:n})}catch(t){r.textContent=e.text}e.parentNode.replaceChild(r,e)}))}(),o=o.default}()}));

@@ -103,3 +103,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

var stringMap = {
const stringMap = {
"(": "left parenthesis",

@@ -177,3 +177,3 @@ ")": "right parenthesis",

};
var powerMap = {
const powerMap = {
"prime": "prime",

@@ -185,11 +185,11 @@ "degree": "degrees",

};
var openMap = {
const openMap = {
"|": "open vertical bar",
".": ""
};
var closeMap = {
const closeMap = {
"|": "close vertical bar",
".": ""
};
var binMap = {
const binMap = {
"+": "plus",

@@ -206,3 +206,3 @@ "-": "minus",

};
var relMap = {
const relMap = {
"=": "equals",

@@ -223,3 +223,3 @@ "\\approx": "approximately equals",

};
var accentUnderMap = {
const accentUnderMap = {
"\\underleftarrow": "left arrow",

@@ -233,3 +233,3 @@ "\\underrightarrow": "right arrow",

var buildString = function buildString(str, type, a11yStrings) {
const buildString = (str, type, a11yStrings) => {
if (!str) {

@@ -239,3 +239,3 @@ return;

var ret;
let ret;

@@ -268,4 +268,4 @@ if (type === "open") {

var buildRegion = function buildRegion(a11yStrings, callback) {
var regionStrings = [];
const buildRegion = (a11yStrings, callback) => {
const regionStrings = [];
a11yStrings.push(regionStrings);

@@ -275,3 +275,3 @@ callback(regionStrings);

var handleObject = function handleObject(tree, a11yStrings, atomType) {
const handleObject = (tree, a11yStrings, atomType) => {
// Everything else is assumed to be an object...

@@ -281,3 +281,3 @@ switch (tree.type) {

{
buildRegion(a11yStrings, function (a11yStrings) {
buildRegion(a11yStrings, a11yStrings => {
buildA11yStrings(tree.base, a11yStrings, atomType);

@@ -293,3 +293,3 @@ a11yStrings.push("with");

{
buildRegion(a11yStrings, function (a11yStrings) {
buildRegion(a11yStrings, a11yStrings => {
buildA11yStrings(tree.base, a11yStrings, atomType);

@@ -311,3 +311,5 @@ a11yStrings.push("with");

{
var text = tree.text;
const {
text
} = tree;

@@ -364,4 +366,4 @@ switch (tree.family) {

{
var color = tree.color.replace(/katex-/, "");
buildRegion(a11yStrings, function (regionStrings) {
const color = tree.color.replace(/katex-/, "");
buildRegion(a11yStrings, regionStrings => {
regionStrings.push("start color " + color);

@@ -392,6 +394,8 @@ buildA11yStrings(tree.body, regionStrings, atomType);

{
buildRegion(a11yStrings, function (regionStrings) {
buildRegion(a11yStrings, regionStrings => {
// genfrac can have unbalanced delimiters
var leftDelim = tree.leftDelim,
rightDelim = tree.rightDelim; // NOTE: Not sure if this is a safe assumption
const {
leftDelim,
rightDelim
} = tree; // NOTE: Not sure if this is a safe assumption
// hasBarLine true -> fraction, false -> binomial

@@ -435,3 +439,3 @@

{
buildRegion(a11yStrings, function (regionStrings) {
buildRegion(a11yStrings, regionStrings => {
buildString(tree.left, "open", regionStrings);

@@ -464,4 +468,6 @@ buildA11yStrings(tree.body, regionStrings, atomType);

{
var body = tree.body,
name = tree.name;
const {
body,
name
} = tree;

@@ -545,8 +551,10 @@ if (body) {

{
buildRegion(a11yStrings, function (regionStrings) {
var body = tree.body,
index = tree.index;
buildRegion(a11yStrings, regionStrings => {
const {
body,
index
} = tree;
if (index) {
var indexString = flatten(buildA11yStrings(index, [], atomType)).join(",");
const indexString = flatten(buildA11yStrings(index, [], atomType)).join(",");

@@ -576,6 +584,8 @@ if (indexString === "3") {

{
var base = tree.base,
sub = tree.sub,
sup = tree.sup;
var isLog = false;
const {
base,
sub,
sup
} = tree;
let isLog = false;

@@ -588,3 +598,3 @@ if (base) {

if (sub) {
var regionName = isLog ? "base" : "subscript";
const regionName = isLog ? "base" : "subscript";
buildRegion(a11yStrings, function (regionStrings) {

@@ -599,3 +609,3 @@ regionStrings.push("start " + regionName);

buildRegion(a11yStrings, function (regionStrings) {
var supString = flatten(buildA11yStrings(sup, [], atomType)).join(",");
const supString = flatten(buildA11yStrings(sup, [], atomType)).join(",");

@@ -815,6 +825,5 @@ if (supString in powerMap) {

// 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
const atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass
buildA11yStrings(tree.body, a11yStrings, _atomType);
buildA11yStrings(tree.body, a11yStrings, atomType);
break;

@@ -861,3 +870,3 @@ }

var buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType) {
const buildA11yStrings = function (tree, a11yStrings, atomType) {
if (a11yStrings === void 0) {

@@ -868,3 +877,3 @@ a11yStrings = [];

if (tree instanceof Array) {
for (var i = 0; i < tree.length; i++) {
for (let i = 0; i < tree.length; i++) {
buildA11yStrings(tree[i], a11yStrings, atomType);

@@ -879,4 +888,4 @@ }

var flatten = function flatten(array) {
var result = [];
const flatten = function (array) {
let result = [];
array.forEach(function (item) {

@@ -892,6 +901,6 @@ if (item instanceof Array) {

var renderA11yString = function renderA11yString(text, settings) {
var tree = katex__WEBPACK_IMPORTED_MODULE_0___default().__parse(text, settings);
const renderA11yString = function (text, settings) {
const tree = katex__WEBPACK_IMPORTED_MODULE_0___default().__parse(text, settings);
var a11yStrings = buildA11yStrings(tree, [], "normal");
const a11yStrings = buildA11yStrings(tree, [], "normal");
return flatten(a11yStrings).join(", ");

@@ -898,0 +907,0 @@ };

@@ -1,1 +0,1 @@

!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<r.length;o++)e(r[o],a,t);else m(r,a,t);return a},w=function e(r){var a=[];return r.forEach((function(r){r instanceof Array?a=a.concat(e(r)):a.push(r)})),a},g.default=function(e,r){var a=n().__parse(e,r),t=f(a,[],"normal");return w(t).join(", ")},g=g.default}()}));
!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 t="object"==typeof exports?r(require("katex")):r(e.katex);for(var a in t)("object"==typeof exports?exports:e)[a]=t[a]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var r={771:function(r){r.exports=e}},t={};function a(e){var o=t[e];if(void 0!==o)return o.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,a),n.exports}a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,{a:r}),r},a.d=function(e,r){for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)};var o={};return function(){var e=a(771),r=a.n(e);const t={"(":"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"},n={prime:"prime",degree:"degrees",circle:"degrees",2:"squared",3:"cubed"},s={"|":"open vertical bar",".":""},l={"|":"close vertical bar",".":""},i={"+":"plus","-":"minus","\\pm":"plus minus","\\cdot":"dot","*":"times","/":"divided by","\\times":"times","\\div":"divided by","\\circ":"circle","\\bullet":"bullet"},c={"=":"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"},u={"\\underleftarrow":"left arrow","\\underrightarrow":"right arrow","\\underleftrightarrow":"left-right arrow","\\undergroup":"group","\\underlinesegment":"line segment","\\utilde":"tilde"},p=(e,r,a)=>{if(!e)return;let o;o="open"===r?e in s?s[e]:t[e]||e:"close"===r?e in l?l[e]:t[e]||e:"bin"===r?i[e]||e:"rel"===r?c[e]||e:t[e]||e,/^\d+$/.test(o)&&a.length>0&&/^\d+$/.test(a[a.length-1])?a[a.length-1]+=o:o&&a.push(o)},d=(e,r)=>{const t=[];e.push(t),r(t)},h=function(e,r,t){if(void 0===r&&(r=[]),e instanceof Array)for(let a=0;a<e.length;a++)h(e[a],r,t);else((e,r,t)=>{switch(e.type){case"accent":d(r,(r=>{h(e.base,r,t),r.push("with"),p(e.label,"normal",r),r.push("on top")}));break;case"accentUnder":d(r,(r=>{h(e.base,r,t),r.push("with"),p(u[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":{const{text:t}=e;switch(e.family){case"bin":p(t,"bin",r);break;case"close":p(t,"close",r);break;case"inner":p(e.text,"inner",r);break;case"open":p(t,"open",r);break;case"punct":p(t,"punct",r);break;case"rel":p(t,"rel",r);break;default:throw e.family,new Error('"'+e.family+'" is not a valid atom type')}break}case"color":{const a=e.color.replace(/katex-/,"");d(r,(r=>{r.push("start color "+a),h(e.body,r,t),r.push("end color "+a)}));break}case"delimsizing":e.delim&&"."!==e.delim&&p(e.delim,"normal",r);break;case"genfrac":d(r,(r=>{const{leftDelim:a,rightDelim:o}=e;e.hasBarLine?(r.push("start fraction"),a&&p(a,"open",r),h(e.numer,r,t),r.push("divided by"),h(e.denom,r,t),o&&p(o,"close",r),r.push("end fraction")):(r.push("start binomial"),a&&p(a,"open",r),h(e.numer,r,t),r.push("over"),h(e.denom,r,t),o&&p(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":h(e.body,r,t);break;case"leftright":d(r,(r=>{p(e.left,"open",r),h(e.body,r,t),p(e.right,"close",r)}));break;case"mathord":p(e.text,"normal",r);break;case"op":{const{body:a,name:o}=e;a?h(a,r,t):o&&p(o,"normal",r);break}case"op-token":case"textord":p(e.text,t,r);break;case"overline":d(r,(function(r){r.push("start overline"),h(e.body,r,t),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":d(r,(r=>{const{body:a,index:o}=e;if(o)return"3"===b(h(o,[],t)).join(",")?(r.push("cube root of"),h(a,r,t),void r.push("end cube root")):(r.push("root"),r.push("start index"),h(o,r,t),void r.push("end index"));r.push("square root of"),h(a,r,t),r.push("end square root")}));break;case"supsub":{const{base:a,sub:o,sup:s}=e;let l=!1;if(a&&(h(a,r,t),l="op"===a.type&&"\\log"===a.name),o){const e=l?"base":"subscript";d(r,(function(r){r.push("start "+e),h(o,r,t),r.push("end "+e)}))}s&&d(r,(function(e){const r=b(h(s,[],t)).join(",");r in n?e.push(n[r]):(e.push("start superscript"),h(s,e,t),e.push("end superscript"))}));break}case"text":if("\\textbf"===e.font){d(r,(function(r){r.push("start bold text"),h(e.body,r,t),r.push("end bold text")}));break}d(r,(function(r){r.push("start text"),h(e.body,r,t),r.push("end text")}));break;case"enclose":if(/cancel/.test(e.label)){d(r,(function(r){r.push("start cancel"),h(e.body,r,t),r.push("end cancel")}));break}if(/box/.test(e.label)){d(r,(function(r){r.push("start box"),h(e.body,r,t),r.push("end box")}));break}if(/sout/.test(e.label)){d(r,(function(r){r.push("start strikeout"),h(e.body,r,t),r.push("end strikeout")}));break}if(/phase/.test(e.label)){d(r,(function(r){r.push("start phase angle"),h(e.body,r,t),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":p("start verbatim","normal",r),p(e.body,"normal",r),p("end verbatim","normal",r);break;case"environment":throw new Error("KaTeX-a11y: environment not implemented yet");case"horizBrace":p("start "+e.label.slice(1),"normal",r),h(e.base,r,t),p("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":d(r,(function(r){r.push("start underline"),h(e.body,r,t),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":{const t=e.mclass.slice(1);h(e.body,r,t);break}case"mathchoice":h(e.text,r,t);break;case"htmlmathml":h(e.mathml,r,t);break;case"middle":p(e.delim,t,r);break;default:throw e.type,new Error("KaTeX a11y un-recognized type: "+e.type)}})(e,r,t);return r},b=function(e){let r=[];return e.forEach((function(e){e instanceof Array?r=r.concat(b(e)):r.push(e)})),r};o.default=function(e,t){const a=r().__parse(e,t),o=h(a,[],"normal");return b(o).join(", ")}}(),o=o.default}()}));

@@ -40,9 +40,9 @@ <h1><a href="https://katex.org/">

<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.css" integrity="sha384-wcIxkf4k558AjM3Yz3BBFQUbk/zgIYC2R0QpeeYb+TwlBVMrlgLqwRjRtGZiK7ww" crossorigin="anonymous">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.js" integrity="sha384-hIoBPJpTUs74ddyc4bFZSM1TVlQDA60VBbJS0oA934VSz82sBx1X7kSx2ATBDIyd" crossorigin="anonymous"></script>
<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>

@@ -49,0 +49,0 @@ </head>

{
"name": "katex",
"version": "0.16.9",
"version": "0.16.10",
"description": "Fast math typesetting for the web.",

@@ -50,3 +50,3 @@ "main": "dist/katex.js",

"license": "MIT",
"packageManager": "yarn@3.2.2",
"packageManager": "yarn@4.1.1",
"devDependencies": {

@@ -53,0 +53,0 @@ "@babel/core": "^7.18.13",

@@ -40,9 +40,9 @@ <h1><a href="https://katex.org/">

<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.css" integrity="sha384-wcIxkf4k558AjM3Yz3BBFQUbk/zgIYC2R0QpeeYb+TwlBVMrlgLqwRjRtGZiK7ww" crossorigin="anonymous">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.js" integrity="sha384-hIoBPJpTUs74ddyc4bFZSM1TVlQDA60VBbJS0oA934VSz82sBx1X7kSx2ATBDIyd" crossorigin="anonymous"></script>
<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>

@@ -49,0 +49,0 @@ </head>

@@ -318,3 +318,4 @@ // @flow

toMarkup(): string {
let markup = `<img src='${this.src} 'alt='${this.alt}' `;
let markup = `<img src="${utils.escape(this.src)}"` +
` alt="${utils.escape(this.alt)}"`;

@@ -516,3 +517,3 @@ // Add the styles, after hyphenation

if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
markup += ` ${attr}='${this.attributes[attr]}'`;
markup += ` ${attr}="${utils.escape(this.attributes[attr])}"`;
}

@@ -558,5 +559,5 @@ }

if (this.alternate) {
return `<path d='${this.alternate}'/>`;
return `<path d="${utils.escape(this.alternate)}"/>`;
} else {
return `<path d='${path[this.pathName]}'/>`;
return `<path d="${utils.escape(path[this.pathName])}"/>`;
}

@@ -592,3 +593,3 @@ }

if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
markup += ` ${attr}='${this.attributes[attr]}'`;
markup += ` ${attr}="${utils.escape(this.attributes[attr])}"`;
}

@@ -595,0 +596,0 @@ }

@@ -249,2 +249,14 @@ // @flow

/**
* Increment `expansionCount` by the specified amount.
* Throw an error if it exceeds `maxExpand`.
*/
countExpansion(amount: number): void {
this.expansionCount += amount;
if (this.expansionCount > this.settings.maxExpand) {
throw new ParseError("Too many expansions: infinite loop or " +
"need to increase maxExpand setting");
}
}
/**
* Expand the next token only once if possible.

@@ -280,7 +292,3 @@ *

}
this.expansionCount++;
if (this.expansionCount > this.settings.maxExpand) {
throw new ParseError("Too many expansions: infinite loop or " +
"need to increase maxExpand setting");
}
this.countExpansion(1);
let tokens = expansion.tokens;

@@ -380,2 +388,5 @@ const args = this.consumeArgs(expansion.numArgs, expansion.delimiters);

}
// Count all of these tokens as additional expansions, to prevent
// exponential blowup from linearly many \edef's.
this.countExpansion(output.length);
return output;

@@ -382,0 +393,0 @@ }

@@ -408,4 +408,5 @@ // @flow

// same as a (sub|super)script of regular characters.
let str = uSubsAndSups[lex.text];
const isSub = unicodeSubRegEx.test(lex.text);
const subsupTokens = [];
subsupTokens.push(new Token(uSubsAndSups[lex.text]));
this.consume();

@@ -417,7 +418,7 @@ // Continue fetching tokens to fill out the string.

if (unicodeSubRegEx.test(token) !== isSub) { break; }
subsupTokens.unshift(new Token(uSubsAndSups[token]));
this.consume();
str += uSubsAndSups[token];
}
// Now create a (sub|super)script.
const body = (new Parser(str, this.settings)).parse();
const body = this.subparse(subsupTokens);
if (isSub) {

@@ -424,0 +425,0 @@ subscript = {type: "ordgroup", mode: "math", body};

@@ -349,3 +349,7 @@ // @flow

if (context.url && !context.protocol) {
context.protocol = utils.protocolFromUrl(context.url);
const protocol = utils.protocolFromUrl(context.url);
if (protocol == null) {
return false;
}
context.protocol = protocol;
}

@@ -352,0 +356,0 @@ const trust = typeof this.trust === "function"

@@ -207,3 +207,3 @@ // @flow

defineSymbol(math, ams, rel, "\u226e", "\\nless", true);
// Symbol names preceeded by "@" each have a corresponding macro.
// Symbol names preceded by "@" each have a corresponding macro.
defineSymbol(math, ams, rel, "\ue010", "\\@nleqslant");

@@ -210,0 +210,0 @@ defineSymbol(math, ams, rel, "\ue011", "\\@nleqq");

@@ -96,7 +96,26 @@ // @flow

* Return the protocol of a URL, or "_relative" if the URL does not specify a
* protocol (and thus is relative).
* protocol (and thus is relative), or `null` if URL has invalid protocol
* (so should be outright rejected).
*/
export const protocolFromUrl = function(url: string): string {
const protocol = /^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(url);
return (protocol != null ? protocol[1] : "_relative");
export const protocolFromUrl = function(url: string): string | null {
// Check for possible leading protocol.
// https://url.spec.whatwg.org/#url-parsing strips leading whitespace
// (U+20) or C0 control (U+00-U+1F) characters.
// eslint-disable-next-line no-control-regex
const protocol = /^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i
.exec(url);
if (!protocol) {
return "_relative";
}
// Reject weird colons
if (protocol[2] !== ":") {
return null;
}
// Reject invalid characters in scheme according to
// https://datatracker.ietf.org/doc/html/rfc3986#section-3.1
if (!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(protocol[1])) {
return null;
}
// Lowercase the protocol
return protocol[1].toLowerCase();
};

@@ -103,0 +122,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc