From 3397737b166b14db254bcf4c21f8018591fae61d Mon Sep 17 00:00:00 2001 From: SeerLite Date: Thu, 1 Apr 2021 22:46:40 -0300 Subject: [PATCH] rc markdown: Fix code fence regex The invalid regex `)\b` currently matches anything, so this didn't cause any errors. It is still invalid though, so I fixed it by moving the `\b` to the end of the non-raw_attribute language name (like the original regex). The raw_attribute one shouldn't need this because the `}` marks the end of the language name anyway. Fixes #4025 --- rc/filetype/markdown.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/markdown.kak b/rc/filetype/markdown.kak index 5e5e92b8..2d7a4d08 100644 --- a/rc/filetype/markdown.kak +++ b/rc/filetype/markdown.kak @@ -48,7 +48,7 @@ evaluate-commands %sh{ ruby rust sass scala scss sh swift toml tupfile typescript yaml sql " for lang in ${languages}; do - printf 'add-highlighter shared/markdown/%s region -match-capture ^(\h*)```\h*(%s|\\{[.=]?%s\\}))\\b ^(\h*)``` regions\n' "${lang}" "${lang}" "${lang}" + printf 'add-highlighter shared/markdown/%s region -match-capture ^(\h*)```\h*(%s\\b|\\{[.=]?%s\\}) ^(\h*)``` regions\n' "${lang}" "${lang}" "${lang}" printf 'add-highlighter shared/markdown/%s/ default-region fill meta\n' "${lang}" [ "${lang}" = kak ] && ref=kakrc || ref="${lang}" printf 'add-highlighter shared/markdown/%s/inner region \A```[^\\n]*\K (?=```) ref %s\n' "${lang}" "${ref}"