diff options
| author | Albert Krewinkel <[email protected]> | 2025-05-28 13:23:24 +0200 |
|---|---|---|
| committer | Albert Krewinkel <[email protected]> | 2025-05-28 13:47:49 +0200 |
| commit | 46081560cccc0b8238d247201dd6da49ef57ff92 (patch) | |
| tree | f232a892c70de2e345f5c364581b14facc929b8e /tools | |
| parent | ce5e2a2efc0823833040f917d4470da82b634c13 (diff) | |
tools/update-lua-module-docs: fix handling of wikilinks
The pandoc-internal representation of wikilinks has changed.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/update-lua-module-docs.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/update-lua-module-docs.lua b/tools/update-lua-module-docs.lua index 1491cc7dd..3f80ee28d 100644 --- a/tools/update-lua-module-docs.lua +++ b/tools/update-lua-module-docs.lua @@ -9,6 +9,7 @@ local ipairs, next, pairs, print, tostring, type, warn = ipairs, next, pairs, print, tostring, type, warn local string, table = string, table +local pandoc = require 'pandoc' local utils = require 'pandoc.utils' local read, write = pandoc.read, pandoc.write local Pandoc = pandoc.Pandoc @@ -342,7 +343,7 @@ end local function render_main_pandoc_module (doc) local constants_section = Blocks{Header(2, "Constants")} local fields = List{} - for i, field in ipairs(doc.fields) do + for _, field in ipairs(doc.fields) do if tostring(field.type) == 'string' then constants_section:extend(render_field(field, 2, "pandoc")) elseif field.name:match '^[A-Z]' then @@ -410,8 +411,8 @@ function Reader (inputs) local blocks = process_document(tostring(inputs), Blocks{}, 1) blocks = blocks:walk { Link = function (link) - if link.title == 'wikilink' then - link.title = '' + if link.classes == pandoc.List{'wikilink'} then + link.classes = {} if known_types[link.target] then link.target = '#' .. known_types[link.target] else |
