From d89a356ec5debc5aefc4e2ceb78758f259aa5bc5 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Wed, 3 Jan 2024 13:52:49 -0700 Subject: [PATCH] lua,meta - resolve int keys as ints --- src/resources/filters/quarto-pre/options.lua | 2 ++ .../docs/smoke-all/2024/01/03/issue-8086.qmd | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/docs/smoke-all/2024/01/03/issue-8086.qmd diff --git a/src/resources/filters/quarto-pre/options.lua b/src/resources/filters/quarto-pre/options.lua index 1445a18b49..970991aae8 100644 --- a/src/resources/filters/quarto-pre/options.lua +++ b/src/resources/filters/quarto-pre/options.lua @@ -40,11 +40,13 @@ end function parseOption(name, options, def) local keys = split(name, ".") + quarto.log.output(keys) local value = nil for i, key in ipairs(keys) do if value == nil then value = readOption(options, key, nil) else + key = tonumber(key) or key value = value[key] end diff --git a/tests/docs/smoke-all/2024/01/03/issue-8086.qmd b/tests/docs/smoke-all/2024/01/03/issue-8086.qmd new file mode 100644 index 0000000000..b0d54c53ed --- /dev/null +++ b/tests/docs/smoke-all/2024/01/03/issue-8086.qmd @@ -0,0 +1,19 @@ +--- +title: issue-8086 +testkey: + - "value 1" + - "value 2" +testkey2: + testkey: testvalue +_quarto: + tests: + html: + ensureFileRegexMatches: + - + - "testvalue" + - "value 1" +--- + +{{< meta testkey.1 >}} + +{{< meta testkey2.testkey >}}