From 516c9591b9e92820db1eeec21ae1208132636ddf Mon Sep 17 00:00:00 2001 From: Kylie McClain Date: Thu, 15 Dec 2016 14:06:04 -0500 Subject: [PATCH] base/markdown: Correct italic/bold detection regex As specified at https://daringfireball.net/projects/markdown/syntax#em italics are made with either single asterisks/underscores, and bold is double asterisks/underscores. Before this, single asterisks were understood as bold, and only underscores were understood as italics; both of which behaviors are incorrect. --- rc/base/markdown.kak | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rc/base/markdown.kak b/rc/base/markdown.kak index 3d8814ad..6e3059d5 100644 --- a/rc/base/markdown.kak +++ b/rc/base/markdown.kak @@ -113,8 +113,10 @@ addhl -group /markdown/content regex ^(#+)(\h+)([^\n]+) 1:header addhl -group /markdown/content regex ^\h?+((?:[\s\t]+)?[-\*])\h+[^\n]*(\n\h+[^-\*]\S+[^\n]*\n)*$ 0:list 1:bullet addhl -group /markdown/content regex ^([-=~]+)\n[^\n\h].*?\n\1$ 0:block addhl -group /markdown/content regex \B\+[^\n]+?\+\B 0:mono +addhl -group /markdown/content regex \B\*[^\n]+?\*\B 0:italic addhl -group /markdown/content regex \b_[^\n]+?_\b 0:italic -addhl -group /markdown/content regex \B\*[^\n]+?\*\B 0:bold +addhl -group /markdown/content regex \B\*\*[^\n]+?\*\*\B 0:bold +addhl -group /markdown/content regex \B__[^\n]+?__\B 0:bold addhl -group /markdown/content regex <(([a-z]+://.*?)|((mailto:)?[\w+-]+@[a-z]+[.][a-z]+))> 0:link addhl -group /markdown/content regex ^\h*(>\h*)+ 0:comment addhl -group /markdown/content regex \H\K\h\h$ 0:PrimarySelection