micro/runtime/syntax/markdown.micro

45 lines
893 B
Text
Raw Normal View History

2016-03-21 19:16:02 +03:00
syntax "Markdown" "\.(md|mkd|mkdn|markdown)$"
# Tables (Github extension)
color type ".*[ :]\|[ :].*"
2016-03-21 19:16:02 +03:00
# quotes
color statement "^>.*"
2016-03-21 19:16:02 +03:00
# Emphasis
color type "(^|[[:space:]])(_[^ ][^_]*_|\*[^ ][^*]*\*)"
2016-03-21 19:16:02 +03:00
# Strong emphasis
color type "(^|[[:space:]])(__[^ ][^_]*__|\*\*[^ ][^*]*\*\*)"
2016-03-21 19:16:02 +03:00
# strike-through
color type "(^|[[:space:]])~~[^ ][^~]*~~"
2016-03-21 19:16:02 +03:00
# horizontal rules
color special "^(---+|===+|___+|\*\*\*+)\s*$"
2016-03-21 19:16:02 +03:00
# headlines
color special "^#{1,6}.*"
2016-03-21 19:16:02 +03:00
# lists
color identifier "^[[:space:]]*[\*+-] |^[[:space:]]*[0-9]+\. "
2016-03-21 19:16:02 +03:00
# misc
color preproc "\(([CcRr]|[Tt][Mm])\)" "\.{3}" "(^|[[:space:]])\-\-($|[[:space:]])"
2016-03-21 19:16:02 +03:00
# links
color constant "\[[^]]+\]"
color constant "\[([^][]|\[[^]]*\])*\]\([^)]+\)"
2016-03-21 19:16:02 +03:00
# images
color underlined "!\[[^][]*\](\([^)]+\)|\[[^]]+\])"
2016-03-21 19:16:02 +03:00
# urls
color underlined "https?://[^ )>]+"
2016-03-21 19:16:02 +03:00
# code
color special "`.*?`|^ {4}[^-+*].*"
2016-03-21 19:16:02 +03:00
# code blocks
color special "^```$"