1
0
mirror of https://github.com/scopatz/nanorc synced 2024-09-19 21:16:00 +02:00
nanorc/markdown.nanorc
ThomasR ed2fa75484 Improve markdown.nanorc
support for tables, strike-through, horizontal rules; better image highlighting
2016-02-28 14:15:46 +01:00

48 lines
1005 B
Plaintext

syntax "markdown" "\.(md|mkd|mkdn|markdown)$"
# Tables (Github extension)
color cyan ".*[ :]\|[ :].*"
# quotes
color brightblack "^>.*"
# Emphasis
color green "(^|[[:space:]])(_[^ ][^_]*_|\*[^ ][^*]*\*)"
# Strong emphasis
color brightgreen "(^|[[:space:]])(__[^ ][^_]*__|\*\*[^ ][^*]*\*\*)"
# strike-through
color red "(^|[[:space:]])~~[^ ][^~]*~~"
# horizontal rules
color brightmagenta "^(---+|===+|___+|\*\*\*+)\s*$"
# headlines
color brightmagenta "^#{1,6}.*"
# lists
color blue "^[[:space:]]*[\*+-] |^[[:space:]]*[0-9]+\. "
# leading whitespace
color black "^[[:space:]]+"
# misc
color magenta "\(([CcRr]|[Tt][Mm])\)" "\.{3}" "(^|[[:space:]])\-\-($|[[:space:]])"
# links
color brightblue "\[[^]]+\]"
color brightblue "\[([^][]|\[[^]]*\])*\]\([^)]+\)"
# images
color magenta "!\[[^][]*\](\([^)]+\)|\[[^]]+\])"
# urls
color brightyellow "https?://[^ )>]+"
# code
color yellow "`[^`]*`|^ {4}[^-+*].*"
# code blocks
color yellow start="^```[^$]" end="^```$"
color yellow "^```$"