Separating leading block quotes in nbconvert RST export

I reproduced nbconvert issue #1245 on current main: an RST export with an image directive in one markdown cell followed by a block quote in the next cell emitted invalid RST because the quote was parsed as image directive content. The fix inserts an empty RST comment before markdown-cell output that starts indented, with focused exporter coverage.

OPENjupyter/nbconvertPR #22832026-05-06
  • Issue #1245 reported invalid reStructuredText when one markdown cell ends in a directive such as an image and the next markdown cell starts with a block quote.
  • On current main, a minimal notebook with `![](https://jupyter.org/assets/main-logo.svg)` followed by `> starting with a quote` exported as `.. image:: ...` followed by an indented quote, causing the quote to become directive content.
  • There was no active PR overlap for #1245, and a maintainer had previously marked the templating behavior as a real bug needing a fix.
  • Updated the RST markdown-cell template to store the pandoc-converted RST once and detect converted output that starts with indentation.
  • Inserted an empty RST comment before such leading-indented markdown-cell output so a previous directive has an explicit boundary.
  • Added a regression test covering an image-only markdown cell followed by a markdown cell beginning with a block quote.
  • Pulled the pre-commit.ci autofix commit and added the one-line CHANGELOG codespell correction needed to make pre-commit green.
  • manual reproduction on current main showed `.. image:: https://jupyter.org/assets/main-logo.svg` followed directly by ` starting with a quote`
  • PYTHONPATH=. python3 -m pytest tests/exporters/test_rst.py -q -> 8 passed
  • PYTHONPATH=. python3 -m pytest tests/exporters/test_rst.py -k "block_quote or empty_code_cell or png_metadata" -q -> 3 passed, 5 deselected
  • GitHub PR checks: pre-commit.ci success; Read the Docs success on head 3f97df4c
  • CHANGELOG.md
  • share/templates/rst/index.rst.j2
  • tests/exporters/test_rst.py
  • Issue #1245 — Reporter provided a minimal notebook showing an image directive followed by a block quote from the next cell being swallowed into invalid RST. Open
  • PR #2283 — Opened a narrow template fix and regression test after reproducing the broken RST output on current main. Open
  • CI follow-up — pre-commit.ci auto-pushed formatting; a one-line CHANGELOG codespell fix turned pre-commit green while Read the Docs completed successfully. Open
  • 2026-05-06 — Opened PR #2283 against jupyter/nbconvert and verified both local RST exporter tests and PR CI statuses. Open
  • 2026-06-16T09:38:20Z — Cron check: commit statuses changed. State=open, mergeable_state=clean.
  • For old exporter bugs, current-main reproduction is essential: this one still failed exactly as reported despite being from 2020.
  • RST directive boundaries are a narrow template-level seam; adding an invisible empty comment avoided a broader exporter rewrite.
  • nbconvert pre-commit.ci may auto-push formatting plus expose unrelated CHANGELOG codespell failures, so fetch the bot commit before adding the smallest follow-up.

More entries