mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 03:38:39 +00:00
Add code for generating HTML
Test Plan: Ran unit tests. Looked at `\blue{\displaystyle \left(\dfrac{a^\sigma}{\sin \theta}\right\Updownarrow \intop_{1/2}^{z^z} \sum_{i=0}^\infty x \,dx}` in Chrome and saw the future in my eyes. Reviewers: emily Reviewed By: emily Subscribers: jessie Differential Revision: http://phabricator.khanacademy.org/D13154
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
var katex = require("../katex");
|
||||
var buildTree = require("../buildTree");
|
||||
var parseTree = require("../parseTree");
|
||||
var ParseError = require("../ParseError");
|
||||
@@ -986,3 +987,14 @@ describe("A bin builder", function() {
|
||||
expect(getBuilt("\\blue{x+}+y")[1].classes).toContain("mord");
|
||||
});
|
||||
});
|
||||
|
||||
describe("A markup generator", function() {
|
||||
it("marks trees up", function() {
|
||||
// Just a few quick sanity checks here...
|
||||
var markup = katex.renderToString("\\sigma^2");
|
||||
expect(markup.indexOf("<span")).toBe(0);
|
||||
expect(markup).toContain("\u03c3"); // sigma
|
||||
expect(markup).toContain("margin-right");
|
||||
expect(markup).not.toContain("marginRight");
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user