diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/update-readme.lua | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/tools/update-readme.lua b/tools/update-readme.lua index eabaf2285..38662d627 100644 --- a/tools/update-readme.lua +++ b/tools/update-readme.lua @@ -8,15 +8,21 @@ f:close() result = {} function Div(elem) - local ident = elem.identifier or "" - local get = function(el) - if el.identifier == ident then - result = el - end - end - if ident == 'input-formats' or ident == 'output-formats' then - pandoc.walk_block(pandoc.Div(mdoc.blocks), { Div = get }) - return result + local ident = elem.identifier or "" + local fixrel = function(el) + if el.target:match("^#") then + el.target = "https://pandoc.org/MANUAL.html" .. el.target end + return el + end + local get = function(el) + if el.identifier == ident then + result = pandoc.walk_block(el, { Link = fixrel }) + end + end + if ident == 'input-formats' or ident == 'output-formats' then + pandoc.walk_block(pandoc.Div(mdoc.blocks), { Div = get }) + return result + end end |