mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-08 12:38:39 +00:00
buildHTML's buildExpression is destructive, changing the tree object, this clones the object first before manipulating it.
This commit is contained in:
@@ -1157,6 +1157,10 @@ var buildGroup = function(group, options, prev) {
|
|||||||
* nodes.
|
* nodes.
|
||||||
*/
|
*/
|
||||||
var buildHTML = function(tree, settings) {
|
var buildHTML = function(tree, settings) {
|
||||||
|
// buildExpression is destructive, so we need to make a clone
|
||||||
|
// of the incoming tree so that it isn't accidentally changed
|
||||||
|
tree = JSON.parse(JSON.stringify(tree));
|
||||||
|
|
||||||
var startStyle = Style.TEXT;
|
var startStyle = Style.TEXT;
|
||||||
if (settings.displayMode) {
|
if (settings.displayMode) {
|
||||||
startStyle = Style.DISPLAY;
|
startStyle = Style.DISPLAY;
|
||||||
|
Reference in New Issue
Block a user