Skip to content

Commit 1dd50d3

Browse files
liushuailiushuai
authored andcommitted
update markdown format
1 parent 8acb335 commit 1dd50d3

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

lua/modules/configs/completion/mason-null-ls.lua

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ M.setup = function()
66
automatic_installation = false,
77
automatic_setup = true,
88
handlers = {
9-
-- mdformat is installed via mason but we don't want it formatting
10-
-- markdown (no null-ls source registration at all).
11-
mdformat = function() end,
9+
mdformat = function(source, types)
10+
local null_ls = require("null-ls")
11+
null_ls.register(null_ls.builtins.formatting.mdformat)
12+
end,
1213
-- Suppress automatic_setup for prettier; it is manually registered
1314
-- in null-ls.lua with an explicit filetype list that excludes markdown.
1415
-- Without this, automatic_setup would re-register prettier with its
@@ -21,7 +22,16 @@ M.setup = function()
2122
null_ls.register(null_ls.builtins.diagnostics.markdownlint.with({
2223
extra_args = {
2324
"--disable",
24-
"MD013", "MD025", "MD033", "MD041", "MD055", "MD056", "MD058", "MD060", "MD103",
25+
"MD013",
26+
"MD025",
27+
"MD033",
28+
"MD041",
29+
"MD055",
30+
"MD056",
31+
"MD058",
32+
"MD060",
33+
"MD103",
34+
"MD022",
2535
},
2636
}))
2737
end,

0 commit comments

Comments
 (0)