summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeRoyce Pearson <minergeemili@gmail.com>2017-12-08 16:04:43 -0600
committerLeRoyce Pearson <minergeemili@gmail.com>2017-12-08 16:04:43 -0600
commit3acf3aa5a20221de35333fca246f87bb6c5003cb (patch)
treed87d75d539d14125a52477011ef151b890a83309
parent079b006cdab6f0ae594f80fff18ad61b71b0754d (diff)
Fix overlapping inline markup
Make it some some text like "**bold**" wil not be marked as italic and bold.
-rw-r--r--rc/base/markdown.kak9
1 files changed, 5 insertions, 4 deletions
diff --git a/rc/base/markdown.kak b/rc/base/markdown.kak
index 0aa09719..4269a99c 100644
--- a/rc/base/markdown.kak
+++ b/rc/base/markdown.kak
@@ -112,10 +112,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 \B\*[^\n]+?\*\B 0:italic
-add-highlighter shared/markdown/content regex \b_[^\n]+?_\b 0:italic
-add-highlighter shared/markdown/content regex \B\*\*[^\n]+?\*\*\B 0:bold
-add-highlighter shared/markdown/content regex \B__[^\n]+?__\B 0:bold
+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 <(([a-z]+://.*?)|((mailto:)?[\w+-]+@[a-z]+[.][a-z]+))> 0:link
add-highlighter shared/markdown/content regex ^\h*(>\h*)+ 0:comment
add-highlighter shared/markdown/content regex \H\K\h\h$ 0:PrimarySelection