diff --git a/data/plugins/language_md.lua b/data/plugins/language_md.lua index c69a4583..1046657d 100644 --- a/data/plugins/language_md.lua +++ b/data/plugins/language_md.lua @@ -112,6 +112,7 @@ syntax.add { { pattern = { "%$%$", "%$%$", "\\" }, type = "string", syntax = ".tex"}, { regex = { "\\$", [[\$|(?=\\*\n)]], "\\" }, type = "string", syntax = ".tex"}, -- code blocks + { pattern = { "```caddyfile", "```" }, type = "string", syntax = "Caddyfile" }, { pattern = { "```c++", "```" }, type = "string", syntax = ".cpp" }, { pattern = { "```cpp", "```" }, type = "string", syntax = ".cpp" }, { pattern = { "```python", "```" }, type = "string", syntax = ".py" }, @@ -149,14 +150,15 @@ syntax.add { { pattern = { "```", "```" }, type = "string" }, { pattern = { "``", "``" }, type = "string" }, { pattern = { "%f[\\`]%`[%S]", "`" }, type = "string" }, + -- lines + { pattern = "^%-%-%-+\n" , type = "comment" }, + { pattern = "^%*%*%*+\n", type = "comment" }, + { pattern = "^___+\n", type = "comment" }, + { pattern = "^===+\n", type = "comment" }, -- strike { pattern = { "~~", "~~" }, type = "keyword2" }, -- highlight { pattern = { "==", "==" }, type = "literal" }, - -- lines - { pattern = "^%-%-%-+$" , type = "comment" }, - { pattern = "^%*%*%*+$", type = "comment" }, - { pattern = "^___+$", type = "comment" }, -- bold and italic { pattern = { "%*%*%*%S", "%*%*%*" }, type = "markdown_bold_italic" }, { pattern = { "%*%*%S", "%*%*" }, type = "markdown_bold" }, @@ -175,7 +177,7 @@ syntax.add { type = { "keyword", "function", "string", "function" } }, -- headings - { pattern = "^#+%s.+$", type = "keyword" }, + { pattern = "^#+%s.+\n", type = "keyword" }, -- superscript and subscript { pattern = "%^()%d+()%^",