Skip to content

[BUG] More than 1 Block Quote in Text causes IndexError when converting to ipynb #60

@mmcky

Description

@mmcky

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions