1
0
mirror of https://github.com/scopatz/nanorc synced 2024-11-14 05:04:16 +01:00
nanorc/markdown.nanorc
TUSF 8d01fc00f8
Fixing quotes that span more than one line.
To break out of a quote-block in markdown, one has to have two line-breaks. It's the same as usual paragraphs, so having only one line-break results in it being collapsed as a single space. To represent that behavior here, I'm using start-end, with the previous match being the "start", and a blank line (^$) being the "end".
2017-12-20 23:49:51 -06:00

52 lines
1.1 KiB
Plaintext

syntax "Markdown" "\.(md|mkd|mkdn|markdown)$"
# Tables (Github extension)
color cyan ".*[ :]\|[ :].*"
# quotes
color brightblack start="^>" end="^$"
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 "^```$"
## Trailing spaces
color ,green "[[:space:]]+$"