Add ICJ108 table style and RTL Typst helpers.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-18 13:55:25 +03:30
parent f98054498d
commit 727e038ca7
4 changed files with 76 additions and 8 deletions

15
filters/ltr-spans.lua Normal file
View File

@@ -0,0 +1,15 @@
-- Preserve [text]{dir="ltr"} in Typst PDF (Pandoc HTML keeps the attribute;
-- Typst needs an explicit text(dir: ltr) wrapper).
function Span(el)
if not el.attributes or el.attributes.dir ~= "ltr" then
return nil
end
if not quarto.doc.is_format("typst") then
return nil
end
local text = pandoc.utils.stringify(el.content)
:gsub("\\", "\\\\")
:gsub("%]", "\\]")
:gsub("@", "\\@")
return pandoc.RawInline("typst", "#text(dir: ltr)[" .. text .. "]")
end