I'm writing reST quite a lot and finally got to the point where I had to submit a patch :) While doing so, I discovered there was an unmerged https://phabricator.kde.org/D7245 which lacked a test file. This one *does* have a test file but compared to the other patch doesn't add the default / Sphinx directives / roles since I don't personally have any use for these. Adding everyone involved with the other patch as a reviewer here, hope that's okay :)
- Both .. code-block:: and .. code:: are valid, the former is a Sphinx thing, while .. code :: is a reStructuredText builtin.
- Directives, interpreted text roles and fields can contain : in the name. Used very often by Sphinx and CMake docs. Until now, things like .. py:function:: were treated as comments. Colons in field names are *not* handled by this patch, as the handling in the highlighting file is non-trivial, I am completely new to this and thus have a fear of breaking things :)
- A .. alone on a line is a comment too, doesn't need to be followed by a space. This also makes it work for multi-line comments where the first line is just a ...
- Highlighting default interpreted text role (single backticks) similarly to named roles.
The CMake test was the only place testing for reST highlighting, referencing the umerged https://phabricator.kde.org/D7245, updated it accordingly and removed the patch reference since the problems shown there are fixed by this patch.
The test for reST contains some additional things like block quotes, lists, definition lists etc., which are currently not highlighted (but e.g. Markdown highlighter handles them). This test data might be useful for further improvements to the highlighter.