Schema: Fix inserted Markdown

This commit is contained in:
Lars Mueller 2020-12-22 12:42:28 +01:00
parent 5399a0f302
commit 43612117c9

@ -106,7 +106,8 @@ function configuration(modname)
local modified = false local modified = false
readme = readme:gsub("<!%-%-modlib:conf:(%d)%-%->" .. "(.-)" .. "<!%-%-modlib:conf%-%->", function(level, content) readme = readme:gsub("<!%-%-modlib:conf:(%d)%-%->" .. "(.-)" .. "<!%-%-modlib:conf%-%->", function(level, content)
schema._md_level = assert(tonumber(level)) + 1 schema._md_level = assert(tonumber(level)) + 1
local markdown = schema:generate_markdown() -- HACK: Newline between comment and heading (MD implementations don't handle comments properly)
local markdown = "\n" .. schema:generate_markdown()
if content ~= markdown then if content ~= markdown then
modified = true modified = true
return "<!--modlib:conf:" .. level .. "-->" .. markdown .. "<!--modlib:conf-->" return "<!--modlib:conf:" .. level .. "-->" .. markdown .. "<!--modlib:conf-->"