File tree 3 files changed +34
-8
lines changed
src/resources/filters/quarto-post
tests/docs/smoke-all/2024/10/23 3 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -284,14 +284,17 @@ function render_typst_css_property_processing()
284
284
Table = function (tab )
285
285
_warnings = new_table ()
286
286
local tabstyle = tab .attributes [' style' ]
287
+ local has_typst_text = false
287
288
if tabstyle ~= nil then
288
289
for clause in tabstyle :gmatch (' ([^;]+)' ) do
289
290
local k , v = to_kv (clause )
290
291
if k == ' font-family' then
291
292
tab .attributes [' typst:text:font' ] = translate_string_list (v )
293
+ has_typst_text = true
292
294
end
293
295
if k == ' font-size' then
294
296
tab .attributes [' typst:text:size' ] = _quarto .format .typst .css .translate_length (v , _warnings )
297
+ has_typst_text = true
295
298
end
296
299
end
297
300
end
@@ -311,7 +314,13 @@ function render_typst_css_property_processing()
311
314
end
312
315
aggregate_warnings ()
313
316
_warnings = nil
314
- return tab
317
+ if not has_typst_text then return tab end
318
+ -- Create Div wrapper and return false to prevent processing its contents
319
+ return pandoc .Div ({
320
+ pandoc .RawBlock (" typst" , " #[" ),
321
+ tab ,
322
+ pandoc .RawBlock (" typst" , " ]" )
323
+ }), false
315
324
end ,
316
325
Div = function (div )
317
326
_warnings = new_table ()
Original file line number Diff line number Diff line change @@ -122,13 +122,7 @@ function render_typst_fixups()
122
122
Table = function (tbl )
123
123
-- https://github.com/quarto-dev/quarto-cli/issues/10438
124
124
tbl .classes :insert (" typst:no-figure" )
125
-
126
- -- Create Div wrapper and return false to prevent processing its contents
127
- return pandoc .Div ({
128
- pandoc .RawBlock (" typst" , " #[" ),
129
- tbl ,
130
- pandoc .RawBlock (" typst" , " ]" )
131
- }), false
125
+ return tbl
132
126
end ,
133
127
Para = function (para )
134
128
if # para .content ~= 1 then
Original file line number Diff line number Diff line change
1
+ ---
2
+ format : typst
3
+ _quarto :
4
+ tests :
5
+ typst :
6
+ ensurePdfRegexMatches :
7
+ -
8
+ - ' Paragraph text before is 11pt'
9
+ - ' Paragraph text after is 11pt'
10
+ -
11
+ - ' Paragraph text after is 6pt'
12
+
13
+ ---
14
+
15
+ Paragraph text before is ` #context text.size ` {=typst}.
16
+
17
+ ``` {=html}
18
+ <table style="font-size: 8px;">
19
+ <tr><td>A</td><td>B</td></tr>
20
+ </table>
21
+ ```
22
+
23
+ Paragraph text after is ` #context text.size ` {=typst}.
You can’t perform that action at this time.
0 commit comments