Implemented `\href' command (#923)

* Implements `\href' command.

* Added `functions/href.js`.
* Added `domTree.anchor` and `buildCommon.makeAnchor` functions.
* Make `buildHTML.getTypeOfDomTree` exported.

* Reflects the code reviews

* Create new argType "url" to treat link string in math appropriately
* Stop using too shorten variable names
* Start using template strings

* Adopts template literal

* Elaborates on glueing

* If-clause restructuring

* Solved confusing explanation

* Allow balanced braces in url

* Adds unit-test for \href

* Adds snapshot tests
This commit is contained in:
Hiromi Ishii
2017-11-24 13:23:35 +09:00
committed by Kevin Barabash
parent 75af19c5bb
commit fd82c4fad0
10 changed files with 335 additions and 2 deletions

View File

@@ -220,6 +220,25 @@ exports[`A MathML builder should render mathchoice as if there was nothing 4`] =
`;
exports[`A MathML builder should set href attribute for href appropriately 1`] = `
<math>
<semantics>
<mrow>
<mrow href="http://example.org">
<mi>
α
</mi>
</mrow>
</mrow>
<annotation encoding="application/x-tex">
\\href{http://example.org}{\\alpha}
</annotation>
</semantics>
</math>
`;
exports[`A MathML builder should use <menclose> for colorbox 1`] = `
<math>