Testing the fix for selecting and formatting de-rendered LaTeX text.
Problem: When clicking on a rendered math element to edit it, the LaTeX text would immediately re-render before you could select or format it.
Solution: Modified the click handler to only auto-convert LaTeX when clicking OUTSIDE of math elements, allowing users to work with the de-rendered LaTeX text.
Test that you can click on math to edit it, then select the LaTeX text without it disappearing.
$E = mc^2$Test that font color can be applied to LaTeX text after de-rendering.
$a^2 + b^2 = c^2$Test clicking between multiple math elements without issues.
Test that LaTeX auto-converts back to math when clicking elsewhere.
$\int x dx$Test a realistic editing workflow with selection and formatting.