Skip to content

Commit baf3fb0

Browse files
authored
Disable italics (#7)
* Prevent .DS_Store files from being added to git * Enforce icon to be normal * Add release note and bump dev version
1 parent 1a89344 commit baf3fb0

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
*.pdf
33
*_files/
44
/.luarc.json
5-
docs/_site/
5+
docs/_site/
6+
.DS_Store

_extensions/custom-callout/_extension.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
title: custom-callout
22
author: James Joseph Balamuta
3-
version: 0.0.1-dev.1
3+
version: 0.0.1-dev.2
44
quarto-required: ">=1.5.0"
55
contributes:
66
filters:

_extensions/custom-callout/customcallout.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,25 @@ local function generateCustomCSS()
6565
css = css .. string.format("div.callout-%s .callout-toggle::before {", type)
6666
css = css .. " background-image: url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"rgb(33, 37, 41)\" class=\"bi bi-chevron-down\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" d=\"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z\"/></svg>');"
6767
css = css .. "}\n"
68-
68+
6969
-- Icon Styling
7070
css = css .. string.format("div.callout-%s.callout-style-default .callout-icon::before, div.callout-%s.callout-titled .callout-icon::before {\n", type, type)
7171

7272
if callout.icon_symbol then
7373
local icon_symbol_str = pandoc.utils.stringify(callout.icon_symbol)
7474
if isFontAwesomeIcon(icon_symbol_str) then
7575
-- Font Awesome icon
76-
css = css .. string.format(" font-family: 'Font Awesome 6 Free';\n")
77-
css = css .. string.format(" content: '%s';\n", fa.fa_unicode(icon_symbol_str))
76+
css = css .. " font-family: 'Font Awesome 6 Free', FontAwesome;\n"
77+
css = css .. " font-style: normal;\n"
78+
css = css .. string.format(" content: '%s' !important;\n", fa.fa_unicode(icon_symbol_str))
7879
else
7980
-- Custom icon symbol
8081
css = css .. string.format(" content: '%s';\n", icon_symbol_str)
8182
end
8283
css = css .. " background-image: none;\n"
8384
else
85+
-- The fallback case
86+
local escapedColor = color:gsub("#", "%%23") -- Escape # in hex colors
8487
css = css .. string.format(" background-image: url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"%s\" class=\"bi bi-exclamation-triangle\" viewBox=\"0 0 16 16\"><path d=\"M7.938 2.016A.13.13 0 0 1 8.002 2a.13.13 0 0 1 .063.016.146.146 0 0 1 .054.057l6.857 11.667c.036.06.035.124.002.183a.163.163 0 0 1-.054.06.116.116 0 0 1-.066.017H1.146a.115.115 0 0 1-.066-.017.163.163 0 0 1-.054-.06.176.176 0 0 1 .002-.183L7.884 2.073a.147.147 0 0 1 .054-.057zm1.044-.45a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566z\"/></svg>');\n", escapedColor)
8588
end
8689

docs/qcustom-callout-release-notes.qmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ format:
88
toc: true
99
---
1010

11-
# 0.0.1-dev.1: ?? (??-??-????)
11+
# 0.0.1-dev.2: ?? (??-??-????)
1212

1313
## Features
1414

@@ -27,6 +27,7 @@ Hello there!
2727

2828
## Bugfixes
2929

30+
- Fixed icons appearing in italics. ([#5](https://github.com/coatless-quarto/custom-callout/issues/5), thanks [@jtkulas](https://github.com/jtkulas))
3031

3132
# 0.0.1: Can you hear me now? (10-21-2024)
3233

0 commit comments

Comments
 (0)