Closed pfalcon closed 2 years ago
Was kindly and promptly helped by @ewdurbin and @di with my previous similar issue https://github.com/pypa/warehouse/issues/4855, so dare to ping them directly. Thanks in advance.
Moved this issue to pypa/readme_renderer.
The raw
directive is not supported, so if there's not a standard way to do this with rST, it seems unlikely that it will be possible.
This isn't a real answer to your question, but are you aware that you can write your description in Markdown instead, which does support strikethrough?
We might be able to support the raw directive unless it takes a file or something. We're not relying on rst producing good HTML anymore since we have bleach.
The linked issue has other alternatives, but they involve suitable class defined in CSS:
.. role:: strike
:class: strike
And using something like this in the CSS file:
.strike {
text-decoration: line-through;
}
And do strikethrough like this:
:strike:`This text is crossed out`
I understand that supporting raw blocks may be dangerous, but perhaps above could be supported.
Well, I guess I could experiment with it, it's just end of my day, I wanted to announce a new release, and suddenly noticed .rst formatting is broken, so just tried to ask a quick question instead...
but are you aware that you can write your description in Markdown instead, which does support strikethrough?
Actually I didn't, I thought Python is tightly coupled with .rst ;-). I'll explore that possibility, thanks.
In that case I hope that maybe this ticket can be left as a kind of feature request...
but they involve suitable class defined in CSS:
And yes, then it wouldn't be portable between sites. My original concern was making it render on Github, that's why I chose raw block. A chance that there's a similarly named CSS class for strikethru on both Github and PyPI (and that it stay that way) is slim...
Reviewing older issues. <strike>
is no longer the recommended way to represent struck text. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strike
Preferred are <del>
and <s>
- but still nothing specific in docutils. We currently allow the del
attribute through our sanitizer, so this works:
.. role:: del
:del:`This text is crossed out`
turns into:
<p><del>This text is crossed out</del></p>
With the appropriate changes on the warehouse CSS side, this would render as desired.
From a portability perspective, as a custom RST role it'd have to be implemented in any system using it. There's a Sphinx extension that conforms to del
as well.
Double-checked this today, and it turns out that we don't need any explicit CSS on warehouse unless we want it, because the major browsers support del
natively already! 🎉
Describe the bug
I'm unable to render strike-thru text in long_description in reStructuredText: https://pypi.org/project/picoweb/1.5/ . Given that there's no builtin strike-thru support in .rst (big-big sigh), I was using one of the methods described in https://stackoverflow.com/questions/15989218/how-to-do-strikethrough-in-a-restructuredtext-file-hosted-on-github , that happened to be:
Well, that doesn't work with PyPI. And I hope I can be kindly guided re: what would work. I both tried to search on google regarding that, and here in bug tracker, in vain.
Keywords for search: strikethru, strike
Expected behavior
I hope I can render strikethru.
To Reproduce URL: https://pypi.org/project/picoweb/1.5/
Problem spot is: