1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-21 16:55:07 -05:00

Merge branch 'feature/markdown-tooling-fixes' into premerge

This commit is contained in:
Jonas Schäfer 2021-03-04 18:02:28 +01:00
commit 2b5ee06703

View File

@ -69,11 +69,12 @@ function Doc(body, metadata, variables)
if field == "legal" then if field == "legal" then
add("&LEGALNOTICE;"); add("&LEGALNOTICE;");
goto next; goto next;
elseif field == "supersedes" or field == "supersededby" then elseif field == "supersedes" or field == "supersededby" or field == "dependencies" then
add(("<%s/>"):format(field)); add(("<%s/>"):format(field));
goto next; goto next;
elseif r ~= "*" and r ~= "?" then elseif r ~= "*" and r ~= "?" then
error(string.format("Missing required metadata field '%s'", field)); io.stderr:write(string.format("Missing REQUIRED metadata field '%s'\n", field));
goto next;
else else
io.stderr:write(string.format("Missing optional metadata field '%s'\n", field)); io.stderr:write(string.format("Missing optional metadata field '%s'\n", field));
goto next; goto next;
@ -138,6 +139,7 @@ end
-- Comments indicate the types of other variables. -- Comments indicate the types of other variables.
function Str(s) function Str(s)
if string.match(s, "^&[%w%-.]+;$") then return s; end
return escape(s) return escape(s)
end end