mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-21 16:55:07 -05:00
Merge pull request #1259 from Zash/xep2md-tool
Fix metadata conversion in markdown scripts
This commit is contained in:
commit
d79c8fafb6
@ -115,7 +115,7 @@ function Doc(body, metadata, variables)
|
|||||||
end
|
end
|
||||||
add("</remark>");
|
add("</remark>");
|
||||||
else
|
else
|
||||||
add(("<%s>%s</%s>"):format(field, tostring(sv), field));
|
add(tostring(sv));
|
||||||
end
|
end
|
||||||
add(string.format("</%s>", field));
|
add(string.format("</%s>", field));
|
||||||
end
|
end
|
||||||
|
@ -247,11 +247,21 @@ local header_schema = [[
|
|||||||
supersededby , shortname , schemaloc* , registry? , discuss? ,
|
supersededby , shortname , schemaloc* , registry? , discuss? ,
|
||||||
expires? , author+ , revision+ , councilnote?)
|
expires? , author+ , revision+ , councilnote?)
|
||||||
]];
|
]];
|
||||||
for field in header_schema:gmatch("%w+") do
|
for field, mod in header_schema:gmatch("(%w+)([*+?]?)") do
|
||||||
events.add_handler(field.."#text", function (event)
|
if mod == "" or mod == "?" then
|
||||||
meta[field] = event.text:match("%S.*%S");
|
events.add_handler(field .. "#text", function(event)
|
||||||
return true;
|
meta[field] = event.text:match("%S.*%S");
|
||||||
end);
|
return true;
|
||||||
|
end);
|
||||||
|
elseif mod == "*" or mod == "+" then
|
||||||
|
events.add_handler(field .. "#text", function(event)
|
||||||
|
if not meta[field] then
|
||||||
|
meta[field] = {};
|
||||||
|
end
|
||||||
|
table.insert(meta[field], event.text:match("%S.*%S"));
|
||||||
|
return true;
|
||||||
|
end);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
|
Loading…
Reference in New Issue
Block a user