Normalize math rendering in docs panel and LSP tooltips#8315
Open
LiquidGunay wants to merge 4 commits intomarimo-team:mainfrom
Open
Normalize math rendering in docs panel and LSP tooltips#8315LiquidGunay wants to merge 4 commits intomarimo-team:mainfrom
LiquidGunay wants to merge 4 commits intomarimo-team:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
for more information, see https://pre-commit.ci
Author
|
I have read the CLA Document and I hereby sign the CLA |
- Normalize math syntax in LSP MarkupContent docs even when kind=plaintext\n- Preserve non-math plaintext docs unchanged\n- Add regression tests for plaintext completion docs containing .. math::\n- Extend normalizeLspDocumentation tests for plaintext math vs literal dollar text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
Fix math rendering consistency for docstrings shown in the Documentation panel and CodeMirror LSP tooltips.
🔍 Description of Changes
This PR normalizes math syntax in both rendering paths:
completion_info) inmarimo/_runtime/complete.pyfrontend/src/core/codemirror/lsp/notebook-lsp.tsBackend
.. math:::math:inline role$...$,$$...$$\(...\),\[...\]__init__docstrings.Frontend (LSP)
frontend/src/core/codemirror/lsp/normalize-markdown-math.ts.<marimo-tex ...>while preserving fenced/inline code.MarkupContentdocs returned askind: plaintextwhen math markers are present by converting them to markdown for rendering.Tests
tests/_runtime/test_complete.pyfor math normalization and code-block safety.frontend/src/core/codemirror/lsp/__tests__/normalize-markdown-math.test.ts.frontend/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts... math::.Validation run
uvx hatch run +py=3.12 test:test tests/_runtime/test_complete.pycd frontend && pnpm test src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts src/core/codemirror/lsp/__tests__/normalize-markdown-math.test.tsScreenshot
📋 Checklist