Skip to content

fix: wrap overflowing MathJax content in rich text#3397

Open
TahaKhan998 wants to merge 1 commit intoinveniosoftware:masterfrom
TahaKhan998:fix/mathjax-description-wrap
Open

fix: wrap overflowing MathJax content in rich text#3397
TahaKhan998 wants to merge 1 commit intoinveniosoftware:masterfrom
TahaKhan998:fix/mathjax-description-wrap

Conversation

@TahaKhan998
Copy link
Copy Markdown

@TahaKhan998 TahaKhan998 commented Apr 1, 2026

❤️ Thank you for your contribution!

Description

Closes CERNDocumentServer/cds-rdm#695

The issue here was not that $...$ was failing to be recognized as LaTeX. I checked this locally and MathJax was already enabled and rendering those expressions correctly. The actual problem was that long or malformed inline MathJax output could overflow its container and push the layout out of bounds.

This PR fixes that as a layout and wrapping issue in invenio-app-rdm.

What changed

  1. Added min-width: 0 to .main-record-content so the main content column can shrink properly inside the flex layout instead of being forced wider by long MathJax content.
  2. Extended the shared wrapping styles in site.overrides so both .rich-input-content and .wrap-overflowing-text also handle rendered MathJax (mjx-container and common inline MathJax elements) with normal wrapping.
  3. Kept search/result titles compact by truncating them to 100 characters in RecordsResultsListItem.js, instead of letting malformed MathJax titles stretch the list view.

Before

image image image image

After

image image image image

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@TahaKhan998 TahaKhan998 force-pushed the fix/mathjax-description-wrap branch from 31f7d37 to 35e787f Compare April 7, 2026 11:06
@TahaKhan998 TahaKhan998 force-pushed the fix/mathjax-description-wrap branch from 9e3b4b1 to 00dafca Compare April 13, 2026 07:58
@TahaKhan998 TahaKhan998 force-pushed the fix/mathjax-description-wrap branch from 00dafca to fd8f573 Compare April 13, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: LaTeX rendering not working properly for description

2 participants