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
detect:
filename: "\\.(livemd|md|mkd|mkdn|markdown)$"
filename: \.(livemd|md|mkd|mkdn|markdown)$
rules:
# Tables (Github extension)
- type: ".*[ :]\\|[ :].*"
# Tables (Github extension)
- type: ".*[ :]\\|[ :].*"
# quotes
- statement: "^>.*"
# quotes
- statement: "^>.*"
# Emphasis
- type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)"
# Emphasis
- type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)"
# Strong emphasis
- type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)"
# Strong emphasis
- type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)"
# strike-through
- type: "(^|[[:space:]])~~[^ ][^~]*~~"
# strike-through
- type: "(^|[[:space:]])~~[^ ][^~]*~~"
# horizontal rules
- special: "^(---+|===+|___+|\\*\\*\\*+)\\s*$"
# horizontal rules
- special: "^(---+|===+|___+|\\*\\*\\*+)\\s*$"
# headlines
- special: "^#{1,6}.*"
# headlines
- special: "^#{1,6}.*"
# lists
- identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. "
# lists
- identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. "
# misc
- preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))"
# misc
- preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))"
# links
- constant: "\\[[^]]+\\]"
- constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)"
# links
- constant: "\\[[^]]+\\]"
- constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)"
# images
- underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])"
# images
- underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])"
# urls
- underlined: "https?://[^ )>]+"
# urls
- underlined: "https?://[^ )>]+"
- 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: "`"
end: "`"
- special:
start: "`"
end: "`"