Skip to content

Commit 4f0ece0

Browse files
committed
typst-css - correctly handle unsupported font-weight values
1 parent a9eadac commit 4f0ece0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/resources/filters/quarto-post/typst-css-property-processing.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ function render_typst_css_property_processing()
171171
elseif k == 'font-size' then
172172
cell.attributes['typst:text:size'] = _quarto.format.typst.css.translate_length(v, _warnings)
173173
elseif k == 'font-weight' then
174-
cell.attributes['typst:text:weight'] = _quarto.format.typst.css.quote(_quarto.format.typst.css.translate_font_weight(v, _warnings))
174+
local translated_fw = _quarto.format.typst.css.translate_font_weight(v, _warnings)
175+
-- unsupported font-weight values will be returned as nil
176+
if translated_fw then
177+
cell.attributes['typst:text:weight'] = _quarto.format.typst.css.quote(translated_fw)
178+
end
175179
elseif k == 'font-style' then
176180
cell.attributes['typst:text:style'] = _quarto.format.typst.css.quote(v)
177181
elseif k == 'vertical-align' then

0 commit comments

Comments
 (0)