MyST-Parser icon indicating copy to clipboard operation
MyST-Parser copied to clipboard

{eval-rst} throws a NotImplementedError with ".. contents::" directive

Open tombakas opened this issue 3 years ago • 1 comments

Description

Using

```{eval-rst}
.. contents::
```

Inside of a markdown file throws the following exception:

Exception occurred:         
  File "/home/tomas/tmp/venv/lib/python3.8/site-packages/sphinx/writers/html5.py", line 790, in unknown_visit
    raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
NotImplementedError: Unknown node: pending

However, if the following is used instead, no exception is thrown:

```{contents}
```

To Reproduce

  1. Set up a virtual environment.
  2. Install sphinx and myst-parser using pip.
  3. Set up a basic project using sphinx-quickstart
  4. Include a markdown file in the toctree of index.rst, let's say test.md.
  5. Put the following in the test.md file:
```{eval-rst}
.. contents::
```
  1. Try to compile it with make html
  2. See error.

Expected behavior

The document compiles without error, the same way it does when the following construction is used:

```{contents}
```

Environment

  • Python version: 3.8.7
  • Sphinx version: 3.5.1
  • Myst parser version: 0.13.5
  • Operating system: Fedora 32

tombakas avatar Feb 16 '21 23:02 tombakas

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Feb 16 '21 23:02 welcome[bot]