From 78f1e1ca985657b75fe7fd12d8783d345ba601e7 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Thu, 15 Mar 2018 18:16:47 +1100 Subject: [PATCH] Highlight footnote-style hyperlinks. As well as the traditional `[text](url)` syntax, Markdown allows the text to be followed by a tag in square brackets. If the text is followed by nothing at all, then the tag for that link is the text itself. The actual URL is supplied later in the document, like a footnote at the bottom of the page: Some text with [a link][tag] and [another link]. [tag]: http://www.example.com/link1 [another link]: http://www.example.com/link2 This adds the "link" face to the URL in such footnote lines. --- rc/base/markdown.kak | 1 + 1 file changed, 1 insertion(+) diff --git a/rc/base/markdown.kak b/rc/base/markdown.kak index 94466a1a..c232769f 100644 --- a/rc/base/markdown.kak +++ b/rc/base/markdown.kak @@ -52,6 +52,7 @@ add-highlighter shared/markdown/content regex [^_](_([^\s_]|([^\s_][^_]*[^\s_])) add-highlighter shared/markdown/content regex [^*](\*\*([^\s*]|([^\s*][^*]*[^\s*]))\*\*)[^*] 1:bold add-highlighter shared/markdown/content regex [^_](__([^\s_]|([^\s_][^_]*[^\s_]))__)[^_] 1:bold add-highlighter shared/markdown/content regex <(([a-z]+://.*?)|((mailto:)?[\w+-]+@[a-z]+[.][a-z]+))> 0:link +add-highlighter shared/markdown/content regex ^\[[^\]\n]*\]:\h*([^\n]*) 1:link add-highlighter shared/markdown/content regex ^\h*(>\h*)+ 0:comment add-highlighter shared/markdown/content regex \H\K\h\h$ 0:PrimarySelection