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:
parent
31e9fc3cef
commit
b633b6f9c3
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user