I wanted to apply smart quotes to the sequence '-' however this is rendered in HTML as ‘-‘ rather than ‘-’.
This was in Sphinx, but they advised me it was in the docutils code. (see https://github.com/sphinx-doc/sphinx/issues/6884)
I can reproduce with
echo "QUOTE '-'" | rst2html.py --smart-quotes=yes|grep QUOTE
also
echo 'QUOTE "-"' | rst2html.py --smart-quotes=yes|grep QUOTE
Using rst2html.py (Docutils 0.15.2 [release], Python 3.7.5, on darwin)
Sorry, the example was
Thank you for reporting the problem.
The reason for this behaviour is, that in some cases, opening quotes should follow hypens (and other characters). Examples are ("this"), ["that"], {'this'} but also---"dumb" as well as literal---dashes.
These are not trivial to differentiate from use cases like "((" or "-".
You may try the attached patch or the advice in http://docutils.sourceforge.net/docs/user/smartquotes.html
"In such cases, it's best to use the recommended apostrophe character (’) in the source".
Last edit: Günter Milde 2019-12-09
OK, thanks for the clarification. I will use 'explicit' smart quotes for this.
Fixed in 0.17b.dev (repository version).
Fixed in Docutils 0.17.
Thank you for reporting.