question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with urls inside markdown tables

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
martinagvilascommented, Apr 15, 2020

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:

image

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.

2reactions
chrisjsewellcommented, Apr 14, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Solved] Markdown links in table cells do not work
I am having a problem with markdown files in Bitbucket repo. My links to headers in the markdown document work only when they...
Read more >
Breaking https links in markdown table without breaking the ...
I am creating tables in markdown and I have web links that are long so on adding the links to the column it...
Read more >
Working with Tables in GitHub Markdown - Pluralsight
A table in markdown consists of two parts. The header. The rows of data in the table. Individual columns in a table are...
Read more >
Using Markdown in the Console - AWS Documentation
This topic explains the types of Markdown formatting supported in the console. ... Text Formatting; Links; Lists; Tables and Buttons (CloudWatch Dashboards) ...
Read more >
Markdown Syntax | Hub - JetBrains
Markdown is supported for the following features in Hub: ... Both of these URLs are parsed as links: <https://youtrack.jetbrains.com/issues> ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found