Skip to content

Commit 3ea3313

Browse files
committed
Only process valid cross reference types
1 parent ed57d10 commit 3ea3313

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/resources/filters/crossref/refs.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function resolveRefs()
1616
-- get the label and type, and note if the label is uppercase
1717
local label = cite.id
1818
local type = refType(label)
19-
if type ~= nil then
19+
if type ~= nil and isValidRefType(type) then
2020
local upper = not not string.match(cite.id, "^[A-Z]")
2121

2222
-- lookup the label
@@ -143,6 +143,9 @@ function refLabelPattern(type)
143143
return "{#(" .. type .. "%-[^ }]+)}"
144144
end
145145

146+
function isValidRefType(type)
147+
return tcontains(validRefTypes(), type)
148+
end
146149

147150
function validRefTypes()
148151
local types = tkeys(theoremTypes)

0 commit comments

Comments
 (0)