From fa586e6ec838cce74b4ac10fb4c68241061b5f23 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 5 Mar 2021 19:19:41 +0100 Subject: 2021-03-05 19:13:00 --- scripts/context/lua/mtx-context.lua | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index 5b159158c..7ae350111 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -1452,20 +1452,29 @@ function scripts.context.pages() end if page or list then if page then + for i=1,#page do + page[i] = string.topattern(page[i]) + end for i=1,#p do local pi = p[i] local m = pi.marked if m then + local ml = #m for j=1,#page do local n = page[j] - if table.contains(m,n) then - report("page : %04i %s",i,n) + for k=1,ml do + if find(m[k],n) then + report("page : %04i %s",i,m[k]) + end end end end end end if list then + for i=1,#list do + list[i] = string.topattern(list[i]) + end for i=1,#l do local li = l[i] local r = li.references @@ -1473,10 +1482,13 @@ function scripts.context.pages() local rr = r.reference if rr then rr = splitstring(rr,",") + local rrl = #rr for j=1,#list do local n = list[j] - if table.contains(rr,n) then - report("list : %04i %s",r.realpage,n) + for k=1,rrl do + if find(rr[k],n) then + report("list : %04i %s",r.realpage,rr[k]) + end end end end -- cgit v1.2.3