This commit is contained in:
Bjørnar Brende Smestad 2025-06-08 11:33:20 +02:00 committed by GitHub
commit 12635818b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,48 +1,108 @@
filetype: markdown filetype: markdown
detect: detect:
filename: "\\.(livemd|md|mkd|mkdn|markdown)$" filename: \.(livemd|md|mkd|mkdn|markdown)$
rules: rules:
# Tables (Github extension) # Tables (Github extension)
- type: ".*[ :]\\|[ :].*" - type: ".*[ :]\\|[ :].*"
# quotes # quotes
- statement: "^>.*" - statement: "^>.*"
# Emphasis # Emphasis
- type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)" - type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)"
# Strong emphasis # Strong emphasis
- type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)" - type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)"
# strike-through # strike-through
- type: "(^|[[:space:]])~~[^ ][^~]*~~" - type: "(^|[[:space:]])~~[^ ][^~]*~~"
# horizontal rules # horizontal rules
- special: "^(---+|===+|___+|\\*\\*\\*+)\\s*$" - special: "^(---+|===+|___+|\\*\\*\\*+)\\s*$"
# headlines # headlines
- special: "^#{1,6}.*" - special: "^#{1,6}.*"
# lists # lists
- identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. " - identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. "
# misc # misc
- preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))" - preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))"
# links # links
- constant: "\\[[^]]+\\]" - constant: "\\[[^]]+\\]"
- constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)" - constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)"
# images # images
- underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])" - underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])"
# urls # urls
- underlined: "https?://[^ )>]+" - underlined: "https?://[^ )>]+"
- special: "^```$" - special: "^```$"
- special: # Fenced code blocks for syntax highlighting
- default:
start: "(?i)^```(c)$"
end: "^```$"
rules:
- include: "c"
- default:
start: "(?i)^```(c\\+\\+|cpp)$"
end: "^```$"
rules:
- include: "c++"
- default:
start: "(?i)^```(csharp|c\\#)$"
end: "^```$"
rules:
- include: "csharp"
- default:
start: "(?i)^```(golang|go)$"
end: "^```$"
rules:
- include: "go"
- default:
start: "(?i)^```(java)$"
end: "^```$"
rules:
- include: "java"
- default:
start: "(?i)^```(javascript|js)$"
end: "^```$"
rules:
- include: "javascript"
- default:
start: "(?i)^```(php)$"
end: "^```$"
rules:
- include: "php"
- default:
start: "(?i)^```(python3|python|py)$"
end: "^```$"
rules:
- include: "python"
- default:
start: "(?i)^```(rust|rs)$"
end: "^```$"
rules:
- include: "rust"
- default:
start: "(?i)^```(sh|powershell|shell|bash)$"
end: "^```$"
rules:
- include: "shell"
- default:
start: "(?i)^```(sql)$"
end: "^```$"
rules:
- include: "sql"
- default:
start: "(?i)^```(typescript|ts)$"
end: "^```$"
rules:
- include: "typescript"
- special:
start: "`" start: "`"
end: "`" end: "`"