Skip to content

Fix notebook markdown soft line breaks#1027

Merged
juliasilge merged 2 commits into
quarto-dev:mainfrom
devmcp:devmcp-fix-notebook-soft-breaks
Jun 29, 2026
Merged

Fix notebook markdown soft line breaks#1027
juliasilge merged 2 commits into
quarto-dev:mainfrom
devmcp:devmcp-fix-notebook-soft-breaks

Conversation

@devmcp

@devmcp devmcp commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Markdown cells in notebooks were rendering soft line breaks as hard paragraph breaks when the Quarto Markdown-It renderer was active. The Pandoc div rule reported every line as a paragraph interrupter during Markdown-It silent validation, so hard-wrapped prose was split before normal Markdown rendering could preserve soft break semantics.

This updates the div parser so silent validation only reports an interruption for actual ::: div markers and does not mutate parser state until the marker is consumed. The new core tests cover both the soft-break regression and the expected paragraph interruption for Pandoc div markers.

Fixes #1017

Tests:

  • npx --yes yarn@1.22.22 workspace core test
  • npx --yes yarn@1.22.22 workspace quarto-vscode-markdownit build
  • npx --yes yarn@1.22.22 build-vscode

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@posit-snyk-bot

posit-snyk-bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@juliasilge

Copy link
Copy Markdown
Collaborator

Thank you so much for this fix, @devmcp! I notice it is still draft, but it looks ready to go to me. Do you have any other changes you want to make before I review?

@devmcp devmcp marked this pull request as ready for review June 29, 2026 20:34
@devmcp

devmcp commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Thank you so much for this fix, @devmcp! I notice it is still draft, but it looks ready to go to me. Do you have any other changes you want to make before I review?

Nope! I think it's good to review. Many thanks!

@juliasilge juliasilge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for this contribution! 🚀

@juliasilge juliasilge merged commit 2368cc5 into quarto-dev:main Jun 29, 2026
6 of 7 checks passed
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.

Single soft line breaks in .ipynb markdown cells render as hard breaks in VS Code when using quarto extension

3 participants