X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fsyntax%2Fmarkdown.yaml;h=bcf629d71c7221515c8b200b1365ecbf5c75cb19;hb=54c23cae72d7237bc898a59f79aad0acffdf0ffe;hp=c4549bc6abc2c07492048559e6f2807ff726cf12;hpb=b977bf5cca84f7dc762fe8d9967831502ee5cc87;p=micro.git diff --git a/runtime/syntax/markdown.yaml b/runtime/syntax/markdown.yaml index c4549bc6..bcf629d7 100644 --- a/runtime/syntax/markdown.yaml +++ b/runtime/syntax/markdown.yaml @@ -1,21 +1,49 @@ filetype: markdown -detect: +detect: filename: "\\.(md|mkd|mkdn|markdown)$" rules: - - preproc: ".*[ :]\\|[ :].*" - - constant.string: "^>.*" + # Tables (Github extension) + - type: ".*[ :]\\|[ :].*" + + # quotes + - statement: "^>.*" + + # Emphasis - type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)" - - type.keyword: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)" + + # Strong emphasis + - type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)" + + # strike-through - type: "(^|[[:space:]])~~[^ ][^~]*~~" - - symbol: "^(---+|\\+---+|===+|\\+===+|___+|\\*\\*\\*+|\\+\\*\\*\\*+)\\s*$" - - statement: "^#{1,6}.*" - - identifier: "^[[:space:]]*[\\*+\\-] |^[[:space:]]*[0-9]+\\. " - - preproc: "\\b([CcRr]|[Tt][Mm])\\b|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]])" + + # horizontal rules + - special: "^(---+|===+|___+|\\*\\*\\*+)\\s*$" + + # headlines + - special: "^#{1,6}.*" + + # lists + - identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. " + + # misc + - preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))" + + # links - constant: "\\[[^]]+\\]" - constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)" + + # images - underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])" - - underlined.url: "https?://[^ )>]+" - - special: "`.*?`|^ {4}[^\\-+*].*" - - symbol: "^```$" + + # urls + - underlined: "https?://[^ )>]+" + + - special: "^```$" + + - special: + start: "`" + end: "`" + rules: []