From 8d24041c1a9fe9d3c81c60aca3b46d065da7b624 Mon Sep 17 00:00:00 2001 From: Lennard Hofmann Date: Sun, 21 Mar 2021 09:52:00 +0100 Subject: [PATCH] rc markdown: Fix HTML highlighting in inline code Because the HTML highlighter was higher up in the hierarchy than the code highlighter, it took precedence. I fixed it by making it an inline region. Using my new knowledge of "inline" I was able to remove one line of code. Fixes #4091 --- rc/filetype/markdown.kak | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rc/filetype/markdown.kak b/rc/filetype/markdown.kak index 181969ef..43f3e601 100644 --- a/rc/filetype/markdown.kak +++ b/rc/filetype/markdown.kak @@ -65,15 +65,13 @@ add-highlighter shared/markdown/listblock/g/ ref markdown/inline add-highlighter shared/markdown/listblock/g/marker regex ^\h*([-*])\s 1:bullet # https://spec.commonmark.org/0.29/#link-destination -# This repetition is not pretty but shell escaping is worse add-highlighter shared/markdown/angle_bracket_url region (?<=<)([a-z]+://|(mailto|magnet|xmpp):) (?!\\).(?=>)|\n fill link -add-highlighter shared/markdown/url region -recurse \( ([a-z]+://|(mailto|magnet|xmpp):) (?!\\).(?=\))|\s fill link +add-highlighter shared/markdown/inline/url region -recurse \( ([a-z]+://|(mailto|magnet|xmpp):) (?!\\).(?=\))|\s fill link add-highlighter shared/markdown/listblock/angle_bracket_url region (?<=<)([a-z]+://|(mailto|magnet|xmpp):) (?!\\).(?=>)|\n fill link -add-highlighter shared/markdown/listblock/url region -recurse \( ([a-z]+://|(mailto|magnet|xmpp):) (?!\\).(?=\))|\s fill link try %{ require-module html - add-highlighter shared/markdown/tag region (?i))) > ref html/tag + add-highlighter shared/markdown/inline/tag region (?i))) > ref html/tag } add-highlighter shared/markdown/inline/code region -match-capture (`+) (`+) fill mono