mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +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:
8
katex.js
8
katex.js
@@ -8,12 +8,18 @@ var process = function(toParse, baseNode) {
|
||||
utils.clearNode(baseNode);
|
||||
|
||||
var tree = parseTree(toParse);
|
||||
var node = buildTree(tree).toDOM();
|
||||
var node = buildTree(tree).toNode();
|
||||
|
||||
baseNode.appendChild(node);
|
||||
};
|
||||
|
||||
var renderToString = function(toParse) {
|
||||
var tree = parseTree(toParse);
|
||||
return buildTree(tree).toMarkup();
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
process: process,
|
||||
renderToString: renderToString,
|
||||
ParseError: ParseError
|
||||
};
|
||||
|
Reference in New Issue
Block a user