Skip to content

Commit

Permalink
fix: use proper warning message for set:icon or set icon (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanouil authored May 1, 2024
1 parent 3f7f825 commit ab0b58e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions _extensions/iconify/iconify.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,15 @@ return {
local icon = pandoc.utils.stringify(args[1])
local set = "fluent-emoji"

if #args > 1 and string.find(pandoc.utils.stringify(args[2]), ":") then
quarto.log.warning(
'Use "set:icon" or "set icon" syntax, not both! ' ..
'Using "set:icon" syntax and discarding first argument!'
)
icon = pandoc.utils.stringify(args[2])
end

if string.find(icon, ":") then
if #args > 1 then
print('Warning: use "set:icon" or "set icon" syntax, not both.')
end
set = string.sub(icon, 1, string.find(icon, ":") - 1)
icon = string.sub(icon, string.find(icon, ":") + 1)
elseif #args > 1 then
Expand Down

0 comments on commit ab0b58e

Please sign in to comment.