From 0a4a9f1c3d07e75c72c5cbc4fb3d937c9c60d4ef Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Thu, 15 Mar 2018 18:26:20 +1100 Subject: [PATCH] Markdown inline formatting should not span paragraphs. Previously, two underscore characters in a document would mark the entire space between them as italic, no matter how far apart. Now we only accept a single consecutive newline within an inline-formatted span, so hard-wrapped documents will still format nicely but stray characters won't mess up your entire document. Note that the highlighter for backtick-enclosed spans was modified, even though it's redundant with the code-block highlighting introduced in 5bc62c694. --- rc/base/markdown.kak | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rc/base/markdown.kak b/rc/base/markdown.kak index c232769f..c03b5a29 100644 --- a/rc/base/markdown.kak +++ b/rc/base/markdown.kak @@ -46,11 +46,11 @@ add-highlighter shared/markdown/content regex ^(#+)(\h+)([^\n]+) 1:header add-highlighter shared/markdown/content regex ^\h?((?:[\s\t]+)?[-\*])\h+[^\n]*(\n\h+[^-\*]\S+[^\n]*\n)*$ 0:list 1:bullet add-highlighter shared/markdown/content regex \B\+[^\n]+?\+\B 0:mono -add-highlighter shared/markdown/content regex [^`](``([^\s`]|([^\s`][^`]*[^\s`]))``)[^`] 1:mono -add-highlighter shared/markdown/content regex [^*](\*([^\s*]|([^\s*][^*]*[^\s*]))\*)[^*] 1:italic -add-highlighter shared/markdown/content regex [^_](_([^\s_]|([^\s_][^_]*[^\s_]))_)[^_] 1:italic -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 [^`](``([^\s`]|([^\s`](\n?[^\n`])*[^\s`]))``)[^`] 1:mono +add-highlighter shared/markdown/content regex [^*](\*([^\s*]|([^\s*](\n?[^\n*])*[^\s*]))\*)[^*] 1:italic +add-highlighter shared/markdown/content regex [^_](_([^\s_]|([^\s_](\n?[^\n_])*[^\s_]))_)[^_] 1:italic +add-highlighter shared/markdown/content regex [^*](\*\*([^\s*]|([^\s*](\n?[^\n*])*[^\s*]))\*\*)[^*] 1:bold +add-highlighter shared/markdown/content regex [^_](__([^\s_]|([^\s_](\n?[^\n_])*[^\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