github / markup

Determines which markup library to use to render a content file (e.g. README) on GitHub
MIT License
5.81k stars 3.41k forks source link

Regression in rendering restructuredText ``sourcecode`` directive #1806

Open trevorld opened 1 month ago

trevorld commented 1 month ago

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:

TicaMica1971 commented 1 month ago

pekkaklarck commented 1 month ago

I noticed our docs looked odd as well, but luckily the workaround to replace .. sourcecode:: with .. code:: worked. Thanks for investigation @trevorld.