markdown-it-py: [BUG] More than 1 Block Quote in Text causes IndexError when converting to ipynb

Describe the bug

If there are more than one block quotes in a myst.md file then jupytext (via markdown-it-py) causes

 File "anaconda3/envs/qe-lectures/lib/python3.8/site-packages/markdown_it/rules_block/state_block.py", line 134, in skipEmptyLines
    if (self.bMarks[from_pos] + self.tShift[from_pos]) < self.eMarks[from_pos]:
IndexError: list index out of range

To Reproduce

A minimal Example

---
jupytext:
  text_representation:
    extension: .md
    format_name: myst
kernelspec:
  display_name: Python 3
  language: python
  name: python3
---

# Simple Example

> A Block Quote

some text

> Another Block Quote


and then run jupytext f<ile.md> --to ipynb

Expected behavior

Notebook output with a single cell containing markdown and two block-quotes

Environment

Jupyter Book: 0.8.3 MyST-NB: 0.10.1 Sphinx Book Theme: 0.0.38 MyST-Parser: 0.12.10 Jupyter-Cache: 0.4.1 NbClient: 0.5.0

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (14 by maintainers)

Commits related to this issue

Most upvoted comments

and you only need this to reproduce:

> A Block Quote

> Another Block Quote


There you go thats the one 👍