mirror of
git://git.sv.gnu.org/nano.git
synced 2025-01-02 15:44:26 +03:00
syntax: markdown: new file -- coloring rules for Markdown files
First-draft-by: Ryan Westlund <rlwestlund@gmail.com>
This commit is contained in:
parent
5755ecdbfc
commit
fb53ad9c3a
@ -21,6 +21,7 @@ pkgdata_DATA = asm.nanorc \
|
||||
lua.nanorc \
|
||||
makefile.nanorc \
|
||||
man.nanorc \
|
||||
markdown.nanorc \
|
||||
nanohelp.nanorc \
|
||||
nanorc.nanorc \
|
||||
nftables.nanorc \
|
||||
|
34
syntax/markdown.nanorc
Normal file
34
syntax/markdown.nanorc
Normal file
@ -0,0 +1,34 @@
|
||||
## Syntax highlighting for Markdown files.
|
||||
|
||||
syntax markdown "\.md$"
|
||||
comment "<!--|-->"
|
||||
|
||||
# Quoted:
|
||||
color magenta "^[ ]*>.*"
|
||||
|
||||
# List-item markers:
|
||||
color brightmagenta "^( | )* ? ? ?(\*|\+|-|[1-9]+\.)( +| )"
|
||||
|
||||
# Emphasis and strong:
|
||||
color green "\*[^*]+\*|_[^_]+_"
|
||||
color brightgreen "\*\*[^*]+\*\*|__[^_]+__"
|
||||
|
||||
# Strikethrough:
|
||||
color red "~~.+~~"
|
||||
|
||||
# URLs and links:
|
||||
color brightblue "\[[^]]+\]\([^)]+\)"
|
||||
color brightmagenta "!?\[[^]]+\]"
|
||||
|
||||
# Code, indented code, and fenced code:
|
||||
color brightcyan "`[^`]+`"
|
||||
color brightcyan start="^( | )+([^*+0-9> -]|[*+-]\S|[0-9][^.]).*" end="^$"
|
||||
color brightcyan start="```" end="```"
|
||||
|
||||
# Headings and the underlining of headings:
|
||||
color brightyellow "^#.*"
|
||||
color brightyellow "^(=+|-+)$"
|
||||
|
||||
# HTML tags and comments:
|
||||
color cyan "<[^>]+>"
|
||||
color cyan start="<!--" end="-->"
|
Loading…
Reference in New Issue
Block a user