pypa / readme_renderer

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

PyPI strips out `align="center"` for headers in markdown #126

Closed darrikonn closed 4 years ago

darrikonn commented 6 years ago

What?

Can't align headers to the center. This is possibly for paragraphs, using:

<p align="center">my text</p>

and this also works on Github when rendering markdowns. But this does not work in PyPI project description. I set:

long_description_content_type='text/markdown'

in my setup.py.

Expected outcome

Header to be center aligned.

<h1 align="center">td-cli</h1>

Actual outcome

<h1>td-cli</h1>

What I tried

Tried adding inline style:

<h1 style="text-align: center;">td-cli</h1>

Tried wrapping header with <center>, both outside and inside:

<center><h1>td-cli</h1></center>
<h1><center>td-cli</center></h1>

Tried using other headers:

h2, h3, ...

Screenshot

image