Replies: 2 comments 1 reply
-
Thanks Piotr. It would be very nice to make improvements in that regard indeed! Your help would be very welcome. I think the following discussions are related, they are about adding information about the start/end index of every part of the AST: I guess we have to think though how to keep track of the original whitespaces. Do you have ideas already in that regard? |
Beta Was this translation helpful? Give feedback.
-
I apologize for the delay. Initially, I believed I could persuade my company to implement this feature here to achieve our goals. However, it turns out we've discovered a reasonably clean approach on top of the Math.js library. As a result, I won't have the time to delve into it here. Let's keep our fingers crossed for the linked pull request, as it appears to be a step toward "source map" and whitespace preservation. |
Beta Was this translation helpful? Give feedback.
-
Hello,
Our app relies heavily on the mathjs parser, which works great for our needs. The only missing feature is the ability to preserve whitespace.
This is what happens now:
math.parse("( 1 + 1 )").toString() // returns "(1 + 1")
And this is what we'd like to happen:
math.parse("( 1 + 1 )", { preserveWhitespace: true }).toString() // returns "( 1 + 1 )"
I am willing to work on this feature, but first I would like to know if there is any interest from the community to include such an option. Has this feature been discussed before? I have searched for relevant issues and discussions but have not found any.
Beta Was this translation helpful? Give feedback.
All reactions