diff --git a/tests/ref/grid-rtl-counter.png b/tests/ref/grid-rtl-counter.png new file mode 100644 index 000000000..fb0df44ad Binary files /dev/null and b/tests/ref/grid-rtl-counter.png differ diff --git a/tests/suite/layout/grid/rtl.typ b/tests/suite/layout/grid/rtl.typ index 7c0e999a2..866c8257b 100644 --- a/tests/suite/layout/grid/rtl.typ +++ b/tests/suite/layout/grid/rtl.typ @@ -193,3 +193,23 @@ ), ..range(0, 10).map(i => ([\##i], table.cell(stroke: green)[123], table.cell(stroke: blue)[456], [789], [?], table.hline(start: 4, end: 5, stroke: red))).flatten() ) + +--- grid-rtl-counter --- +// Test interaction between RTL and counters +#set text(dir: rtl) +#let test = counter("test") +#grid( + columns: (1fr, 1fr), + inset: 5pt, + align: center, + [ + a: // should produce 1 + #test.step() + #context test.get().first() + ], + [ + b: // should produce 2 + #test.step() + #context test.get().first() + ], +)