pypa / readme_renderer

Safely render long_description/README files in Warehouse
Apache License 2.0
158 stars 88 forks source link

RST tables multirow cells rendering #182

Closed marian-code closed 2 years ago

marian-code commented 3 years ago

As I understand this is the lib that powers PyPI REDME rendering so I post this question here.

The problem

PyPI renders multirow cells in a way that it essentially ignores them which messes up the following rows. I have first encounterd this problem when trying to publish package to PyPI: https://pypi.org/project/ssh-utilities/ .

Minimal reproducible example

+---------------+---------------+
| title1        | title2        |
+===============+===============+
| col1          | col2          |
+---------------+---------------+
| mutirow       | cell1         |
|               +---------------+
|               | cell2         |
+---------------+---------------+
| singlerow     | cell3         |
+---------------+---------------+

Render this rst code with readme-renderer

python -m readme_renderer README.rst -o README.html

You will get this: example

In the picture you can see the cell2 is incorrectly possitioned in the first column.

As far as I know RST is not supposed to render like this. So is this a know bug? Does any workaround exist? or is this on purpose?

miketheman commented 2 years ago

Reviewing older issues, this one wasn't responded to.

This does appear to be a missing part of the functionality, as docutils supports this kind of table layout.

It's likely due to us stripping out the necessary directives to support this view during the clean() phase. I'll add some tests and figure out the necessary directives to support this.