Skip to content

John6797/sc 8121/switch from mathml to mathjax for latex formulas#294

Merged
johnwalz97 merged 3 commits intomainfrom
john6797/sc-8121/switch-from-mathml-to-mathjax-for-latex-formulas
Jan 15, 2025
Merged

John6797/sc 8121/switch from mathml to mathjax for latex formulas#294
johnwalz97 merged 3 commits intomainfrom
john6797/sc-8121/switch-from-mathml-to-mathjax-for-latex-formulas

Conversation

@johnwalz97
Copy link
Contributor

@johnwalz97 johnwalz97 commented Jan 14, 2025

Internal Notes for Reviewers

Refactoring to use mathjax instead of mathml in test description html. This aligns with the new math plugin we are using on the frontend.

External Release Notes

@johnwalz97 johnwalz97 added internal Not to be externalized in the release notes DO NOT MERGE PR is not ready to be merged refactor Refactoring existing code labels Jan 14, 2025
@johnwalz97 johnwalz97 requested a review from cachafla January 14, 2025 21:08
@johnwalz97 johnwalz97 removed the DO NOT MERGE PR is not ready to be merged label Jan 14, 2025
@github-actions
Copy link
Contributor

PR Summary

This pull request removes the latex2mathml dependency from the project and updates the way LaTeX is handled in HTML content. The changes include:

  • Removal of latex2mathml from pyproject.toml and poetry.lock files.
  • Modification of the md_to_html function in validmind/utils.py to replace LaTeX with MathJax scripts instead of converting to MathML.
  • Update of the display function to check for MathJax compatibility using math/tex instead of $$.
  • Minor comment update in validmind/html_templates/content_blocks.py to reflect the dynamic loading of MathJax.

Test Suggestions

  • Test the rendering of LaTeX in HTML content to ensure MathJax is correctly processing both block and inline math.
  • Verify that the removal of latex2mathml does not affect other parts of the application that might have relied on it.
  • Check the performance of the md_to_html function to ensure there are no regressions after the changes.
  • Ensure that the application still functions correctly in environments where MathJax is not available.

Copy link
Contributor

@cachafla cachafla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👌

@johnwalz97 johnwalz97 merged commit 0838744 into main Jan 15, 2025
7 checks passed
@johnwalz97 johnwalz97 deleted the john6797/sc-8121/switch-from-mathml-to-mathjax-for-latex-formulas branch January 15, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Not to be externalized in the release notes refactor Refactoring existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants