Skip to content

Commit

Permalink
fix(packages): Empty CSL macros must be suppressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Omikhleia authored and Didier Willis committed Feb 15, 2025
1 parent aab22e7 commit def6d6f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/bibtex/csl/engine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,17 @@ function CslEngine:_text (options, content, entry)
local link
if options.macro then
if self.macros[options.macro] then
-- This is not explicit in the CSL 1.0.2 specification, which mention conditional
-- rendering for groups only. However, macro should behave as it own group, and
-- be suppressed on the same conditions. This is used in a variety of styles, for
-- instance UFES-ABNT, UNEAL-ABNT or ABNT-IPEA have definitions like:
-- <macro name="translator">
-- <text value="Traducao "/>
-- <names variable="translator" delimiter=", ">(...) </names>
-- </macro>
self:_enterGroup()
t = self:_render_children(self.macros[options.macro], entry)
t = self:_leaveGroup(t)
else
SU.error("CSL macro " .. options.macro .. " not found")
end
Expand Down

0 comments on commit def6d6f

Please sign in to comment.