fix: issues parsing with 'preserveLatex' set to 'true' #212
+28
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Noticed that
verbatimLatex
not being saved on BoxedExpression instances created fromce.parse
for some time. Looks as if this traceable to commits:^Wherein there is retraction of passing of 'metadata' to
ce.box
from withince.parse
And:
^In which 'metadata' is retracted both as an argument to 'box' (the function) and its inner forwarding to BoxedExpression constructor calls when handling 'MathJSON object literals'.
As a guess, it appears to me that removing
metadata
as a parameter frombox
was apt due to these properties being foreseen as present on MathJSON object literals: if present at all. Looks however that in these changes that the step of checking for this meta elsewhere (i.e. object literals) and forwarding onwards (like before) is absent.This 'fix' is only an educated guess & seems to address the issue,
But this change/request also appears to break a single test-case within
test/compute-engine/latex-syntax/numbers.test.ts
- which I have not investigated - and thus is not suitable for merging.(Note at the time of this request, the HEAD of main (#115272d, there is already extant a single test failure (
test/compute-engine/functions.test.ts
->Apply -> Function and Hold
), which is not related to this change).Single commit also includes an unused utility
isExpressionObject
, which was initially used, but could now be discarded.(Could also do with a couple of test cases for this feature)