keewis / blackdoc

run black on documentation code snippets
https://blackdoc.readthedocs.io
MIT License
47 stars 4 forks source link

blackdoc crashes for invalid rst ipython blocks #78

Closed keewis closed 3 years ago

keewis commented 3 years ago
.. ipython:: python
    print("abc")
    print("def")

and

.. ipython:: python
    print("abc")<end-of-file>

crash the program. This is because it was assumed that rst directives are always followed by options and then a newline.