Issue with urls inside markdown tables
See original GitHub issueHi! 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top GitHub Comments
It is a great codebase, I agree 🚀
I can try to submit a PR with some tests if you haven’t started working on that already.
I checked the glue features (amazingly awesome 😄) and it seems to be rendering fine with the changes:
The plots do look smaller than here but I tried rendering the same tables without the
<paragraph>
wrapper changes and the size is the same, so I think it is a separate issue.Well its easy, when its such a well written code base 😆
Yeh that’s pretty much it 👍 , I should be able to add it in the next day. Or feel free to make a PR, but make sure the requisite tests are added, and we make want to also check that things like https://myst-nb.readthedocs.io/en/latest/use/glue.html#pasting-into-tables are still work before merging