Skip to content

Commit ab0b58e

Browse files
authored
fix: use proper warning message for set:icon or set icon (#22)
1 parent 3f7f825 commit ab0b58e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

_extensions/iconify/iconify.lua

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,15 @@ return {
8282
local icon = pandoc.utils.stringify(args[1])
8383
local set = "fluent-emoji"
8484

85+
if #args > 1 and string.find(pandoc.utils.stringify(args[2]), ":") then
86+
quarto.log.warning(
87+
'Use "set:icon" or "set icon" syntax, not both! ' ..
88+
'Using "set:icon" syntax and discarding first argument!'
89+
)
90+
icon = pandoc.utils.stringify(args[2])
91+
end
92+
8593
if string.find(icon, ":") then
86-
if #args > 1 then
87-
print('Warning: use "set:icon" or "set icon" syntax, not both.')
88-
end
8994
set = string.sub(icon, 1, string.find(icon, ":") - 1)
9095
icon = string.sub(icon, string.find(icon, ":") + 1)
9196
elseif #args > 1 then

0 commit comments

Comments
 (0)