Skip to content

Commit f004206

Browse files
committed
fix: use fraction type instead of percent to avoid overflow
1 parent 39baf40 commit f004206

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/resources/filters/layout/typst.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ local function render_floatless_typst_layout(panel)
5050
-- synthesize column spec from row
5151
local col_spec = {}
5252
for j, col in ipairs(row) do
53-
table.insert(col_spec, col.attributes["width"])
53+
local width = col.attributes["width"]
54+
if width:sub(-1) == "%" then
55+
width = width:sub(1, -2) .. "fr"
56+
end
57+
table.insert(col_spec, width)
5458
end
5559
-- TODO allow configurable gutter
5660
local col_spec_str = "columns: (" .. table.concat(col_spec, ", ") .. "), gutter: 1em, rows: 1,"

0 commit comments

Comments
 (0)