From a7a1cbb8302897ba72bd4d6b308dbeaa3f029dc5 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 27 Jul 2022 21:55:43 +0200 Subject: Update --- scripts/metadata.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/metadata.lua b/scripts/metadata.lua index 9cb9970..a32ee29 100644 --- a/scripts/metadata.lua +++ b/scripts/metadata.lua @@ -44,7 +44,7 @@ function page_sort(order) return function(p1, p2) if p1.position then if p2.position then - return tonumber(p1.position) < tonumber(p2.position) + return p1.position < p2.position else return true end @@ -170,7 +170,7 @@ function find_depth(pages) for i = 1, #pages.all do local p = pages.all[i] - local d = tonumber(p.depth) + 1 + local d = p.depth + 1 if d > depth then depth = d end end @@ -289,7 +289,7 @@ function process(global, meta) if meta.list_order then meta.list_order = pandoc.utils.stringify(meta.list_order) end meta.list_layout = meta.list_layout and prep_layout(meta.list_layout) if meta.list_limit then meta.list_limit = tonumber(pandoc.utils.stringify(meta.list_limit)) end - if meta.position then meta.position = pandoc.utils.stringify(meta.position) end + if meta.position then meta.position = tonumber(pandoc.utils.stringify(meta.position)) end if meta.feed then if meta.file_out:match(".html$") then -- cgit v1.2.3-70-g09d2