From a65a2b293ac8f3e0fa0fd0913936f4b3bd9be419 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Sun, 2 Oct 2022 21:45:54 -0400 Subject: [PATCH] plugins language_md: fixed some regressions, added caddyfile support --- data/plugins/language_md.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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+()%^",