1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-09-21 01:37:44 +03:00

rc restructuredtext: fix code block regex

Commit 9ea6b88c1 (Fix remaining kak scripts to use the new highlighter
syntax, 2018-07-01) changed the regex that detects HTML code blocks
from

	\.\.\h*code::\h*html\h*\n

to

	\.\.\h*html::\h*c\h*\n

the stray c looks wrong. According to
https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#showing-code-examples
a code block looks like

	.. code-block:: html

	   Some HTML code.

Correct the regex accordingly.

The original version used "code" instead of "cod- block".  That was
incorrect because "code" requires a different syntax (no "..") and
creates inline code blocks (for which we could add highlighting
later), see
https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-code
This commit is contained in:
Johannes Altmanninger 2022-08-13 22:32:36 +02:00
parent 31e9fc3cef
commit b633b6f9c3

View File

@ -33,7 +33,7 @@ evaluate-commands %sh{
perl pug python ragel ruby rust sass scala scss sh swift \
tupfile yaml; do
if [ "$ft" = kak ]; then ref="kakrc"; else ref="$ft"; fi
printf 'add-highlighter shared/restructuredtext/%s region %s %s ref %s\n' "$ft" '\.\.\h*'$ft'::\h*c\h*\n' '^(?=\S)' "$ref"
printf 'add-highlighter shared/restructuredtext/%s region %s %s ref %s\n' "$ft" "\.\.\h*code-block::\h*$ft\h*\n" '^(?=\S)' "$ref"
done
}