Comparing version 0.13.14 to 0.13.16
# Changelog | ||
All notable changes to this project will be documented in this file. This CHANGELOG roughly follows the guidelines from [www.keepachangelog.com](https://keepachangelog.com/en/1.0.0/). | ||
## [0.13.16](https://github.com/KaTeX/KaTeX/compare/v0.13.15...v0.13.16) (2021-08-28) | ||
### Bug Fixes | ||
* \char support for >16-bit Unicode characters ([#3006](https://github.com/KaTeX/KaTeX/issues/3006)) ([ff1734f](https://github.com/KaTeX/KaTeX/commit/ff1734f7c4882fb350cb0e1f366f04ce63675643)), closes [#3004](https://github.com/KaTeX/KaTeX/issues/3004) | ||
* remove local macros upon parse error ([#3114](https://github.com/KaTeX/KaTeX/issues/3114)) ([a6f29e3](https://github.com/KaTeX/KaTeX/commit/a6f29e36121a31b46866d1985bbc86a06080fbd4)), closes [#3122](https://github.com/KaTeX/KaTeX/issues/3122) | ||
## [0.13.15](https://github.com/KaTeX/KaTeX/compare/v0.13.14...v0.13.15) (2021-08-28) | ||
### Features | ||
* text-mode cedilla accent via \c ([#3036](https://github.com/KaTeX/KaTeX/issues/3036)) ([952fb84](https://github.com/KaTeX/KaTeX/commit/952fb844da9c99d5fca41a87b86e8857a677c899)), closes [#638](https://github.com/KaTeX/KaTeX/issues/638) | ||
## [0.13.14](https://github.com/KaTeX/KaTeX/compare/v0.13.13...v0.13.14) (2021-08-28) | ||
@@ -5,0 +20,0 @@ |
@@ -24,4 +24,4 @@ # Copy-tex extension | ||
```html | ||
<link href="https://cdn.jsdelivr.net/npm/katex@0.13.14/dist/contrib/copy-tex.css" rel="stylesheet" type="text/css"> | ||
<script src="https://cdn.jsdelivr.net/npm/katex@0.13.14/dist/contrib/copy-tex.min.js" integrity="sha384-Ep9Es0VCjVn9dFeaN2uQxgGcGmG+pfZ4eBaHxUpxXDORrrVACZVOpywyzvFRGbmv" crossorigin="anonymous"></script> | ||
<link href="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/contrib/copy-tex.css" rel="stylesheet" type="text/css"> | ||
<script src="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/contrib/copy-tex.min.js" integrity="sha384-Ep9Es0VCjVn9dFeaN2uQxgGcGmG+pfZ4eBaHxUpxXDORrrVACZVOpywyzvFRGbmv" crossorigin="anonymous"></script> | ||
``` | ||
@@ -41,3 +41,3 @@ | ||
```html | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.13.14/dist/contrib/copy-tex.mjs" integrity="sha384-+gSYJ3yzY30+a6FGYJXOx9swmWs5oPKEi1AeCsAxsLexABlUXgHXkOkEZCj0Lz8U" crossorigin="anonymous"></script> | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/contrib/copy-tex.mjs" integrity="sha384-+gSYJ3yzY30+a6FGYJXOx9swmWs5oPKEi1AeCsAxsLexABlUXgHXkOkEZCj0Lz8U" crossorigin="anonymous"></script> | ||
``` | ||
@@ -44,0 +44,0 @@ |
@@ -14,3 +14,3 @@ # `math/tex` Custom Script Type Extension | ||
```html | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.14/dist/contrib/mathtex-script-type.min.js" integrity="sha384-lfASb0Jhxn21qr4pih+Mx6uK2+JEKTtnpMnsCo+PTmb3n/iSUhox6v7eGkBfi47O" crossorigin="anonymous"></script> | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/contrib/mathtex-script-type.min.js" integrity="sha384-lfASb0Jhxn21qr4pih+Mx6uK2+JEKTtnpMnsCo+PTmb3n/iSUhox6v7eGkBfi47O" 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.13.14/dist/katex.min.css" integrity="sha384-olCGZRyRuwqK7wUf99rH5baew52IfIXvG6tE1vC0WSCGyC8xoxN+mQdGm6Xa3EEy" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/katex@0.13.14/dist/katex.min.js" integrity="sha384-rIL/+2u0s1C9mGY06v6oUFDSywqCk4P4hPV+5oIJ45eVj4JdqjNedesyl+6MOEXo" crossorigin="anonymous"></script> | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.14/dist/contrib/mathtex-script-type.min.js" integrity="sha384-lfASb0Jhxn21qr4pih+Mx6uK2+JEKTtnpMnsCo+PTmb3n/iSUhox6v7eGkBfi47O" crossorigin="anonymous"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/katex.min.css" integrity="sha384-6LkG2wmY8FK9E0vU9OOr8UvLwsaqUg9SETfpq4uTCN1agNe8HRdE9ABlk+fVx6gZ" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/katex.min.js" integrity="sha384-31El76TwmbHj4rF9DyLsygbq6xoIobG0W+jqXim+a3dU9W53tdH3A/ngRPxOzzaB" crossorigin="anonymous"></script> | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/contrib/mathtex-script-type.min.js" integrity="sha384-lfASb0Jhxn21qr4pih+Mx6uK2+JEKTtnpMnsCo+PTmb3n/iSUhox6v7eGkBfi47O" crossorigin="anonymous"></script> | ||
</head> | ||
@@ -40,2 +40,2 @@ <body> | ||
```html | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.13.14/dist/contrib/mathtex-script-type.mjs" integrity="sha384-4EJvC5tvqq9XJxXvdD4JutBokuFw/dCe2AB4gZ9sRpwFFXECpL3qT43tmE0PkpVg" crossorigin="anonymous"></script> | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.13.16/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.13.14/dist/contrib/mhchem.min.js" integrity="sha384-LIgAiYlGSAdpNC9+YDjDPF6JeS/RRIumtNo0CmyQERZ/+g0h9MbuYQwf/5pQ4Y4M" crossorigin="anonymous"></script> | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/contrib/mhchem.min.js" integrity="sha384-LIgAiYlGSAdpNC9+YDjDPF6JeS/RRIumtNo0CmyQERZ/+g0h9MbuYQwf/5pQ4Y4M" crossorigin="anonymous"></script> | ||
``` | ||
@@ -13,0 +13,0 @@ |
@@ -34,9 +34,9 @@ # [<img src="https://katex.org/img/katex-logo-black.svg" width="130" alt="KaTeX">](https://katex.org/) | ||
<head> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.14/dist/katex.min.css" integrity="sha384-olCGZRyRuwqK7wUf99rH5baew52IfIXvG6tE1vC0WSCGyC8xoxN+mQdGm6Xa3EEy" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/katex.min.css" integrity="sha384-6LkG2wmY8FK9E0vU9OOr8UvLwsaqUg9SETfpq4uTCN1agNe8HRdE9ABlk+fVx6gZ" crossorigin="anonymous"> | ||
<!-- The loading of KaTeX is deferred to speed up page rendering --> | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.14/dist/katex.min.js" integrity="sha384-rIL/+2u0s1C9mGY06v6oUFDSywqCk4P4hPV+5oIJ45eVj4JdqjNedesyl+6MOEXo" crossorigin="anonymous"></script> | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/katex.min.js" integrity="sha384-31El76TwmbHj4rF9DyLsygbq6xoIobG0W+jqXim+a3dU9W53tdH3A/ngRPxOzzaB" 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.13.14/dist/contrib/auto-render.min.js" integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous" | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/contrib/auto-render.min.js" integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous" | ||
onload="renderMathInElement(document.body);"></script> | ||
@@ -43,0 +43,0 @@ </head> |
{ | ||
"name": "katex", | ||
"version": "0.13.14", | ||
"version": "0.13.16", | ||
"description": "Fast math typesetting for the web.", | ||
@@ -5,0 +5,0 @@ "main": "dist/katex.js", |
@@ -34,9 +34,9 @@ # [<img src="https://katex.org/img/katex-logo-black.svg" width="130" alt="KaTeX">](https://katex.org/) | ||
<head> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.14/dist/katex.min.css" integrity="sha384-olCGZRyRuwqK7wUf99rH5baew52IfIXvG6tE1vC0WSCGyC8xoxN+mQdGm6Xa3EEy" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/katex.min.css" integrity="sha384-6LkG2wmY8FK9E0vU9OOr8UvLwsaqUg9SETfpq4uTCN1agNe8HRdE9ABlk+fVx6gZ" crossorigin="anonymous"> | ||
<!-- The loading of KaTeX is deferred to speed up page rendering --> | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.14/dist/katex.min.js" integrity="sha384-rIL/+2u0s1C9mGY06v6oUFDSywqCk4P4hPV+5oIJ45eVj4JdqjNedesyl+6MOEXo" crossorigin="anonymous"></script> | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/katex.min.js" integrity="sha384-31El76TwmbHj4rF9DyLsygbq6xoIobG0W+jqXim+a3dU9W53tdH3A/ngRPxOzzaB" 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.13.14/dist/contrib/auto-render.min.js" integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous" | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.16/dist/contrib/auto-render.min.js" integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous" | ||
onload="renderMathInElement(document.body);"></script> | ||
@@ -43,0 +43,0 @@ </head> |
@@ -111,7 +111,5 @@ // @flow | ||
'Å': 'A', | ||
'Ç': 'C', | ||
'Ð': 'D', | ||
'Þ': 'o', | ||
'å': 'a', | ||
'ç': 'c', | ||
'ð': 'd', | ||
@@ -118,0 +116,0 @@ 'þ': 'o', |
@@ -77,6 +77,10 @@ // @flow | ||
const accentBelow = group.label === "\\c"; | ||
// calculate the amount of space between the body and the accent | ||
let clearance = Math.min( | ||
body.height, | ||
options.fontMetrics().xHeight); | ||
let clearance = accentBelow | ||
? body.height + body.depth | ||
: Math.min( | ||
body.height, | ||
options.fontMetrics().xHeight); | ||
@@ -104,2 +108,5 @@ // Build the accent | ||
width = accent.width; | ||
if (accentBelow) { | ||
clearance += accent.depth; | ||
} | ||
} | ||
@@ -249,3 +256,3 @@ | ||
"\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', | ||
"\\r", "\\H", "\\v", "\\textcircled", | ||
"\\c", "\\r", "\\H", "\\v", "\\textcircled", | ||
], | ||
@@ -252,0 +259,0 @@ props: { |
@@ -24,5 +24,16 @@ // @flow | ||
} | ||
const code = parseInt(number); | ||
let code = parseInt(number); | ||
let text; | ||
if (isNaN(code)) { | ||
throw new ParseError(`\\@char has non-numeric argument ${number}`); | ||
// If we drop IE support, the following code could be replaced with | ||
// text = String.fromCodePoint(code) | ||
} else if (code < 0 || code >= 0x10ffff) { | ||
throw new ParseError(`\\@char with invalid code point ${number}`); | ||
} else if (code <= 0xffff) { | ||
text = String.fromCharCode(code); | ||
} else { // Astral code point; split into surrogate halves | ||
code -= 0x10000; | ||
text = String.fromCharCode((code >> 10) + 0xd800, | ||
(code & 0x3ff) + 0xdc00); | ||
} | ||
@@ -32,5 +43,5 @@ return { | ||
mode: parser.mode, | ||
text: String.fromCharCode(code), | ||
text: text, | ||
}; | ||
}, | ||
}); |
@@ -78,2 +78,10 @@ // @flow | ||
/** | ||
* Ends all currently nested groups (if any), restoring values before the | ||
* groups began. Useful in case of an error in the middle of parsing. | ||
*/ | ||
endGroups() { | ||
this.macros.endGroups(); | ||
} | ||
/** | ||
* Returns the topmost token on the stack, without expanding it. | ||
@@ -80,0 +88,0 @@ * Similar in behavior to TeX's `\futurelet`. |
@@ -61,2 +61,12 @@ // @flow | ||
/** | ||
* Ends all currently nested groups (if any), restoring values before the | ||
* groups began. Useful in case of an error in the middle of parsing. | ||
*/ | ||
endGroups() { | ||
while (this.undefStack.length > 0) { | ||
this.endGroup(); | ||
} | ||
} | ||
/** | ||
* Detect whether `name` has a definition. Equivalent to | ||
@@ -63,0 +73,0 @@ * `get(name) != null`. |
@@ -133,13 +133,20 @@ // @flow | ||
// Try to parse the input | ||
const parse = this.parseExpression(false); | ||
try { | ||
// Try to parse the input | ||
const parse = this.parseExpression(false); | ||
// If we succeeded, make sure there's an EOF at the end | ||
this.expect("EOF"); | ||
// If we succeeded, make sure there's an EOF at the end | ||
this.expect("EOF"); | ||
// End the group namespace for the expression | ||
if (!this.settings.globalGroup) { | ||
this.gullet.endGroup(); | ||
// End the group namespace for the expression | ||
if (!this.settings.globalGroup) { | ||
this.gullet.endGroup(); | ||
} | ||
return parse; | ||
// Close any leftover groups in case of a parse error. | ||
} finally { | ||
this.gullet.endGroups(); | ||
} | ||
return parse; | ||
} | ||
@@ -955,3 +962,4 @@ | ||
} | ||
const command = unicodeAccents[accent][this.mode]; | ||
const command = unicodeAccents[accent][this.mode] || | ||
unicodeAccents[accent].text; | ||
if (!command) { | ||
@@ -958,0 +966,0 @@ throw new ParseError( |
@@ -709,2 +709,3 @@ // @flow | ||
defineSymbol(text, main, accent, "\u02d9", "\\."); // dot above | ||
defineSymbol(text, main, accent, "\u00b8", "\\c"); // cedilla | ||
defineSymbol(text, main, accent, "\u02da", "\\r"); // ring above | ||
@@ -879,3 +880,3 @@ defineSymbol(text, main, accent, "\u02c7", "\\v"); // caron | ||
// TODO(edemaine): Fix this. | ||
export const extraLatin = "\u00c7\u00d0\u00de\u00e7\u00fe"; | ||
export const extraLatin = "\u00d0\u00de\u00fe"; | ||
for (let i = 0; i < extraLatin.length; i++) { | ||
@@ -882,0 +883,0 @@ const ch = extraLatin.charAt(i); |
@@ -17,2 +17,3 @@ // Mapping of Unicode accent characters to their LaTeX equivalent in text and | ||
'\u030b': {text: '\\H'}, | ||
'\u0327': {text: '\\c'}, | ||
}; |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4287594
61708