syntax: markdown: do not colorize text between two bold words as italic

Also, do not colorize the text between two stricken-through words,
do not colorize text immediately after an indented piece of code,
but do give color to a double trailing space.

Signed-off-by: Ryan Westlund <rlwestlund@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
This commit is contained in:
Benno Schulenberg 2020-04-20 13:29:00 +02:00
parent 890e12fc79
commit c859fd40b6
1 changed files with 8 additions and 5 deletions

View File

@ -10,20 +10,23 @@ color magenta "^[ ]*>.*"
color brightmagenta "^( | )* ? ? ?(\*|\+|-|[1-9]+\.)( +| )" color brightmagenta "^( | )* ? ? ?(\*|\+|-|[1-9]+\.)( +| )"
# Emphasis and strong: # Emphasis and strong:
color green "\*[^*]+\*|_[^_]+_" color green "\*[^* ][^*]*\*|_[^_ ][^_]*_"
color brightgreen "\*\*[^*]+\*\*|__[^_]+__" color brightgreen "\*\*[^*]+\*\*|__[^_]+__"
# Strikethrough: # Strikethrough:
color red "~~.+~~" color red "~~[^~]+~~"
# Line breaks:
color ,blue " $"
# URLs and links: # URLs and links:
color brightblue "\[[^]]+\]\([^)]+\)" color brightblue "\[[^]]+\]\([^)]+\)"
color brightmagenta "!?\[[^]]+\]" color brightmagenta "!?\[[^]]+\]"
# Code, indented code, and fenced code: # Code snippet, indented code, and fenced code:
color brightcyan "`[^`]+`" color brightcyan "`[^`]+`"
color brightcyan start="^( | )+([^*+0-9> -]|[*+-]\S|[0-9][^.]).*" end="^$" color brightcyan "^( | )+ *([^*+0-9> -]|[*+-]\S|[0-9][^.]).*"
color brightcyan start="```" end="```" color brightcyan start="```" end="```$"
# Headings and the underlining of headings: # Headings and the underlining of headings:
color brightyellow "^#.*" color brightyellow "^#.*"