Skip to content

Commit

Permalink
lua,meta - resolve int keys as ints
Browse files Browse the repository at this point in the history
  • Loading branch information
cscheid committed Jan 3, 2024
1 parent 746aae0 commit d89a356
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/resources/filters/quarto-pre/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ end

function parseOption(name, options, def)
local keys = split(name, ".")
quarto.log.output(keys)

This comment has been minimized.

Copy link
@dragonstyle

dragonstyle Jan 4, 2024

Collaborator

@cscheid lol :)

This comment has been minimized.

Copy link
@cscheid

cscheid Jan 4, 2024

Author Collaborator

Sigh.

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

Expand Down
19 changes: 19 additions & 0 deletions tests/docs/smoke-all/2024/01/03/issue-8086.qmd
Original file line number Diff line number Diff line change
@@ -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 >}}

0 comments on commit d89a356

Please sign in to comment.