From e9a69b140a9aa44223c40d56aa738479131600fd Mon Sep 17 00:00:00 2001 From: Volpeon Date: Thu, 11 Nov 2021 13:34:13 +0100 Subject: Fixes --- scripts/metadata_filter.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua index 3bea687..daad940 100644 --- a/scripts/metadata_filter.lua +++ b/scripts/metadata_filter.lua @@ -89,18 +89,17 @@ end function prep_menu(active_id, main_menu) local active_item = nil + local items = pandoc.List() for i = 1, #main_menu do local item = main_menu[i] local active = pandoc.utils.stringify(item.id) == active_id item.active = active if active then active_item = item end + if not item.hidden or item.active then items:insert(item) end end - return { - items = main_menu:filter(function(item) return not item.hidden or item.active end), - active = active_item, - } + return { items = items, active = active_item } end function process_pages(global, pages_by_id) -- cgit v1.2.3-70-g09d2