Regression in rendering restructuredText ``sourcecode`` directive
This is a refinement of #1796
Officially docutils and most other rst renderers like pandoc support three source code directives: code, code-block, and sourcecode. I'm observing that Github restored support for rendering code and code-block directives but that although it rendered the sourcecode directive for years the sourcecode code blocks are still no longer rendering correctly.
.. sourcecode:: python
print(2 + 2)
I have a minimal github repo as an example: https://github.com/trevorld/github_rst_code_rendering
{knitr} uses the sourcecode directive when converting README.Rrst files into README.rst files so this still affects some of my repos.
Here are some links to the docutils and pandoc source code where they explictly support all three of these:
- https://github.com/docutils/docutils/blob/ff0b419256d6b7bfdd4363dd078c2255701de605/docutils/docutils/parsers/rst/languages/en.py#L36
- https://github.com/jgm/pandoc/blob/0c5fd01cb87c179ce8b41dead5d72b7b353d178b/src/Text/Pandoc/Readers/RST.hs#L719
I noticed our docs looked odd as well, but luckily the workaround to replace .. sourcecode:: with .. code:: worked. Thanks for investigation @trevorld.
Stale issue message
Looking at https://github.com/trevorld/github_rst_code_rendering it seems that Github rendering support for the sourcecode directive has been restored.