\char character escaping and nicer MathML via \html@mathml (#1454)

* \html@mathml

Fix #1452

* Add missing file

* Implement \char (via internal \@char)

* Remove excess <mstyle> wrapper on \mathbin etc.

* Fix tests

* Add Unicode support for \copyright and \textregistered

Testing that this doesn't lead to an infinite loop thanks to \char` escaping.

* Add tests

* Use assertNodeType

* Switch from regex to lookup table, and no parseInt
This commit is contained in:
Erik Demaine
2018-07-14 08:36:23 -04:00
committed by GitHub
parent 33ef4bdc63
commit b7277049a4
10 changed files with 259 additions and 61 deletions

View File

@@ -1,7 +1,7 @@
// @flow
import defineFunction, {ordargument} from "../defineFunction";
import buildCommon from "../buildCommon";
import mathMLTree from "../mathMLTree";
import domTree from "../domTree";
import ParseNode from "../ParseNode";
import * as html from "../buildHTML";
@@ -16,7 +16,7 @@ function htmlBuilder(group, options) {
function mathmlBuilder(group, options) {
const inner = mml.buildExpression(group.value.value, options);
return new mathMLTree.MathNode("mstyle", inner);
return new domTree.documentFragment(inner);
}
// Math class commands except \mathop