fix: unwrap top-level paragraph HTML in ipynb markdown import#8691
Open
api2062 wants to merge 2 commits intomarimo-team:mainfrom
Open
fix: unwrap top-level paragraph HTML in ipynb markdown import#8691api2062 wants to merge 2 commits intomarimo-team:mainfrom
api2062 wants to merge 2 commits intomarimo-team:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Author
|
recheck |
Author
|
recheck |
for more information, see https://pre-commit.ci
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
Fixes #8651.
When converting some
.ipynbnotebooks, markdown cells that are stored as HTML paragraph blocks (e.g.<p>...</p>) are imported literally intomo.md(...). This leaves raw HTML tags in converted notebooks and can interfere with normal markdown/LaTeX rendering.This PR normalizes markdown sources that are entirely top-level paragraph blocks before conversion.
🔍 Description of Changes
_normalize_paragraph_html()inmarimo/_convert/common/format.pymarkdown_to_marimo()before markdown code generation<p>...</p>blocks<div><p>...</p></div>) unchangedtests/_convert/common/test_convert_format.pytest_markdown_to_marimo_unwraps_top_level_paragraph_htmltest_markdown_to_marimo_keeps_non_paragraph_htmltests/_convert/ipynb/test_ipynb_to_ir.pytest_convert_ipynb_markdown_unwraps_top_level_paragraph_html✅ Validation
SM_sphere_S2.ipynb)<p>/</p>tags📋 Checklist