]> git.lizzy.rs Git - micro.git/blobdiff - runtime/syntax/markdown.yaml
Merge branch 'python-highlight-zero' of https://github.com/a11ce/micro into a11ce...
[micro.git] / runtime / syntax / markdown.yaml
index c4549bc6abc2c07492048559e6f2807ff726cf12..bcf629d71c7221515c8b200b1365ecbf5c75cb19 100644 (file)
@@ -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: []