Skip to content

Issue with urls inside markdown tables #127

Closed
@martinagvilas

Description

@martinagvilas

Hi! I'm trying to upgrade the turing way book to the new jupyter-book beta version and found a bug when I want to link a url inside a table. I'm kind of new in the world of sphinx, commonmark and parsers, so this might be a bug I need to report to sphinx instead of here. I'm sorry if that is the case!

To give a reproducible example of the error, if I want to build jupyter-book using a single markdown file containing the following:

| Prerequisite | Importance | Notes |
|---|---|---|
| Version Control | Very Important | |
| Reproducible Environments | Very Important | [Binder](https://mybinder.org/) |

(rendered markdown version below)

Prerequisite Importance Notes
Version Control Very Important
Reproducible Environments Very Important Binder

I get the following error:

Exception occurred:
  File "/Users/martina.gonzales/anaconda3/envs/executable-book/lib/python3.7/site-packages/sphinx/writers/html5.py", line 211, in visit_reference
    assert len(node) == 1 and isinstance(node[0], nodes.image)
AssertionError

But if I link it outside the table:

[Binder](https://mybinder.org/)

there is no issue.

One possible reason for the issue, but I might be totally wrong in this: Reading the sphinx error message in context, it seems that the writer in sphinx is expecting the node parent of the reference to be a TextElement. But when I used the MyST API to manually convert these texts to docutils I get that the parent of the reference is <entry>, which I don't think is of text kind. In the isolated reference case (when is not inside the table), the parent node is <paragraph>.

I'm using:

  • sphinx [2.4.4]
  • myst-parser [0.8.0]
  • python [3.7.7]

cc @choldgraf

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