From 09a45a2e964e1efb39335926b2b88ce71e460ee4 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Wed, 27 May 2020 18:21:51 +0800 Subject: [PATCH 1/2] Fix setext-style markdown header highlight Reproduce: - item header ------ --- rc/filetype/markdown.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/filetype/markdown.kak b/rc/filetype/markdown.kak index 6483f158..6c2d17ee 100644 --- a/rc/filetype/markdown.kak +++ b/rc/filetype/markdown.kak @@ -66,8 +66,8 @@ add-highlighter shared/markdown/listblock/content default-region ref markdown/in add-highlighter shared/markdown/inline/code region -match-capture (`+) (`+) fill mono # Setext-style header -add-highlighter shared/markdown/inline/text/ regex (\A|\n\n)[^\n]+\n={2,}\h*\n\h*$ 0:title -add-highlighter shared/markdown/inline/text/ regex (\A|\n\n)[^\n]+\n-{2,}\h*\n\h*$ 0:header +add-highlighter shared/markdown/inline/text/ regex (\A|\n)[^\n]+\n={2,}\h*\n\h*$ 0:title +add-highlighter shared/markdown/inline/text/ regex (\A|\n)[^\n]+\n-{2,}\h*\n\h*$ 0:header # Atx-style header add-highlighter shared/markdown/inline/text/ regex ^#[^\n]* 0:header From 752ccc0946c6136aeceb56eb746820e0b7e311f4 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Thu, 28 May 2020 14:33:00 +0800 Subject: [PATCH 2/2] Fix regression on setext-style markdown header Reproduce: header1 header2 ------- --- rc/filetype/markdown.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/filetype/markdown.kak b/rc/filetype/markdown.kak index 6c2d17ee..686ad629 100644 --- a/rc/filetype/markdown.kak +++ b/rc/filetype/markdown.kak @@ -66,8 +66,8 @@ add-highlighter shared/markdown/listblock/content default-region ref markdown/in add-highlighter shared/markdown/inline/code region -match-capture (`+) (`+) fill mono # Setext-style header -add-highlighter shared/markdown/inline/text/ regex (\A|\n)[^\n]+\n={2,}\h*\n\h*$ 0:title -add-highlighter shared/markdown/inline/text/ regex (\A|\n)[^\n]+\n-{2,}\h*\n\h*$ 0:header +add-highlighter shared/markdown/inline/text/ regex (\A|^\n)[^\n]+\n={2,}\h*\n\h*$ 0:title +add-highlighter shared/markdown/inline/text/ regex (\A|^\n)[^\n]+\n-{2,}\h*\n\h*$ 0:header # Atx-style header add-highlighter shared/markdown/inline/text/ regex ^#[^\n]* 0:header