math_keyboard icon indicating copy to clipboard operation
math_keyboard copied to clipboard

Unnecessary parentheses added by `convertMathExpressionToTeXNode`

Open taojoe opened this issue 3 years ago • 2 comments

Bug description

when I need to set '{a}+{b}' to MathFieldEditingController, the convertMathExpressionToTeXNode add '()' to the expression, which it shouldn't.

To Reproduce

Steps to reproduce the behavior:

  1. run the following code with debug , then you will see the node has 5 leaves, the start and the end leaf are '(', ')'
final node=convertMathExpressionToTeXNode(Parser().parse('{a}+{b}'));

Expected behavior

simple expression should not wrap with '()', '()' is only required when a lower priority expression as part of higher priority expression, like plus/minus expression as part of times expression

Screenshots

none

taojoe avatar Jan 07 '22 02:01 taojoe

Hi 👋🏽 Thank you for opening your first issue with simpleclub/math_keyboard ❤

You can expect triage from us soon 🙂 In the meantime, you can try to search for similar issues in our issue database.

github-actions[bot] avatar Jan 07 '22 02:01 github-actions[bot]

Hi @taojoe, thanks for reporting. This is indeed something that we also noticed. This would require to enhance the way we update the math controller.