Skip to content

Commit 2673a2e

Browse files
authored
fix: title/label args (#17)
Fixes #16
1 parent a7eab83 commit 2673a2e

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/.DS_Store
22
example_files/
33
example.html
4-
54
/.luarc.json
5+
/.quarto

_extensions/iconify/iconify.lua

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ local function is_valid_size(size)
7171
return 'font-size: ' .. value .. ';'
7272
end
7373
end
74-
return 'font-size: ' .. size .. ';'
74+
return 'font-size: ' .. size .. ';'
7575
end
7676

7777
return {
@@ -87,7 +87,7 @@ return {
8787
end
8888

8989
local attributes = ' icon="' .. set .. ':' .. icon .. '"'
90-
local label = '"Icon ' .. icon .. ' from ' .. set .. ' Iconify.design set."'
90+
local default_label = 'Icon ' .. icon .. ' from ' .. set .. ' Iconify.design set.'
9191

9292
local size = is_valid_size(pandoc.utils.stringify(kwargs["size"]))
9393
if not is_empty(size) then
@@ -96,20 +96,20 @@ return {
9696

9797
local aria_label = pandoc.utils.stringify(kwargs["label"])
9898
if is_empty(aria_label) then
99-
aria_label = ' aria-label="' .. label .. '"'
100-
else
101-
attributes = attributes .. aria_label
99+
aria_label = ' aria-label="' .. default_label .. '"'
100+
else
101+
aria_label = ' aria-label="' .. aria_label .. '"'
102102
end
103+
103104
local title = pandoc.utils.stringify(kwargs["title"])
104105
if is_empty(title) then
105-
title = ' title="' .. label .. '"'
106-
else
107-
attributes = attributes .. title
106+
title = ' title="' .. default_label .. '"'
107+
else
108+
title = ' title="' .. title .. '"'
108109
end
109-
-- local style = pandoc.utils.stringify(kwargs["style"])
110-
-- if not is_empty(style) then
111-
-- local attributes = attributes .. ' style="' .. style .. '"'
112-
-- end
110+
111+
attributes = attributes .. aria_label .. title
112+
113113
local width = pandoc.utils.stringify(kwargs["width"])
114114
if not is_empty(width) and is_empty(size) then
115115
attributes = attributes .. ' width="' .. width .. '"'

0 commit comments

Comments
 (0)