From e2c4cb4db9daeec4cce4afd325d7c2bf477a4f30 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 31 Mar 2025 14:37:34 +0200 Subject: [PATCH] test - equation with crossref can be modified in Lua See #383 --- tests/docs/smoke-all/2025/03/31/383.qmd | 24 ++++++++++++++++++++++++ tests/docs/smoke-all/2025/03/31/eq.lua | 4 ++++ 2 files changed, 28 insertions(+) create mode 100644 tests/docs/smoke-all/2025/03/31/383.qmd create mode 100644 tests/docs/smoke-all/2025/03/31/eq.lua diff --git a/tests/docs/smoke-all/2025/03/31/383.qmd b/tests/docs/smoke-all/2025/03/31/383.qmd new file mode 100644 index 00000000000..dcd7ad7bdc1 --- /dev/null +++ b/tests/docs/smoke-all/2025/03/31/383.qmd @@ -0,0 +1,24 @@ +--- +format: + html: default + latex: default +_quarto: + tests: + html: + ensureHtmlElements: + - ['a.quarto-xref[href~="#eq-x"]'] + - [] + ensureFileRegexMatches: + - ['x \+ z \\tag\{1\}'] + - ['x \+ y'] + latex: + ensureFileRegexMatches: + - ['Equation\~\\ref\{eq-x\}', '\\label\{eq-x\}\{x \+ z\}'] + - ['x + y'] +filters: + - eq.lua +--- + +$$x + y$$ {#eq-x} + +See @eq-x. \ No newline at end of file diff --git a/tests/docs/smoke-all/2025/03/31/eq.lua b/tests/docs/smoke-all/2025/03/31/eq.lua new file mode 100644 index 00000000000..abae535f69f --- /dev/null +++ b/tests/docs/smoke-all/2025/03/31/eq.lua @@ -0,0 +1,4 @@ +function Math(el) + el.text = el.text:gsub("y", "z") + return el +end \ No newline at end of file