diff options
| author | jvoisin <julien.voisin@dustri.org> | 2015-01-09 04:04:48 +0100 |
|---|---|---|
| committer | jvoisin <julien.voisin@dustri.org> | 2015-01-09 04:04:48 +0100 |
| commit | e70c686ab020c0009c08331974fc0937178b452b (patch) | |
| tree | 34277ccc0f9cfc1b9bbe10d9ac58d67a43a76933 | |
| parent | 454725c054c7355c90334b057a0350fffd31a9bf (diff) | |
| download | vis-e70c686ab020c0009c08331974fc0937178b452b.tar.gz vis-e70c686ab020c0009c08331974fc0937178b452b.tar.xz | |
Add rudimentary markdown syntax support
The spec is here: http://daringfireball.net/projects/markdown/syntax
Currently, it doesn't support Setext headers and hard-wrapped quotes.
| -rw-r--r-- | config.def.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h index db41216..b833ed1 100644 --- a/config.def.h +++ b/config.def.h @@ -1218,5 +1218,36 @@ static Syntax syntaxes[] = {{ &colors[COLOR_BRACKETS], }} },{ + .name = "markdown", + .file = "\\.(md|mdwn)$", + .rules = {{ + "(^#{1,6}.*$)", //titles + &colors[COLOR_SYNTAX5], + },{ + "((\\* *){3,}|(_ *){3,}|(- *){3,})", // horizontal rules + &colors[COLOR_SYNTAX2], + },{ + "(\\*\\*.*\\*\\*)|(__.*__)", // super-bolds + &colors[COLOR_SYNTAX4], + },{ + "(\\*.*\\*)|(_.*_)", // bolds + &colors[COLOR_SYNTAX3], + },{ + "(\\[.*\\]\\(.*\\))", //links + &colors[COLOR_SYNTAX6], + },{ + "(^ *([-\\*\\+]|[0-9]+\\.))", //lists + &colors[COLOR_SYNTAX2], + },{ + "(^( {4,}|\t+).*$)", // code blocks + &colors[COLOR_SYNTAX7], + },{ + "(`+.*`+)", // inline code + &colors[COLOR_SYNTAX7], + },{ + "(^>+.*)", // quotes + &colors[COLOR_SYNTAX7], + }} + },{ /* empty last element, array terminator */ }}; |
