Skip to content

fix: load sibling modules without the debug library - #12

Merged
mcanouil merged 6 commits into
mainfrom
fix/sibling-loading-without-debug
Oct 18, 2026
Merged

mcanouil merged 6 commits into
mainfrom
fix/sibling-loading-without-debug

Conversation

@mcanouil

Copy link
Copy Markdown
Owner

The six modules that load a sibling (content-extraction, html, metadata, pandoc-helpers, paths, schema-check) found its path with debug.getinfo.
q2 has no debug library, so on q2 these modules failed to load, and an extension that vendors them, such as quarto-iconify, stopped with [Q-16-2] Shortcode script error.

When debug.getinfo is missing, load_sibling now passes the bare name to require.
q2's require looks in the directory of the module being loaded first, so require('string') there loads the sibling string.lua and not the standard library.
quarto-cli keeps the absolute path, because a bare require('string') there does return the standard library.

A new test vendors the modules into a shortcode extension under a path with a space, renders it with quarto and q2, and calls html.raw_header, which needs the real sibling string.lua.
The test workflow now installs q2 v0.34.0 for it.

I also rendered quarto-iconify with these modules on q2 0.34.0: the icon renders, where the released modules give the shortcode error.
Locally, quarto pandoc lua tests/run.lua passes with 214 checks and 0 failures, with q2 0.34.0 on the path.

q2 has no debug library, so every module that loads a sibling failed to load there, and an extension that used one stopped with a shortcode script error. Without debug, load_sibling now passes the bare name to require, which q2 resolves in the directory of the module being loaded. quarto-cli keeps the absolute path, because a bare require('string') there returns the standard library.
@mcanouil mcanouil added the Type: Bug 🐛 Issues related to bugs, errors, or mistakes label Oct 18, 2026
@mcanouil mcanouil self-assigned this Oct 18, 2026
@mcanouil
mcanouil marked this pull request as ready for review October 18, 2026 17:08
@mcanouil
mcanouil merged commit 13e0529 into main Oct 18, 2026
1 check passed
@mcanouil
mcanouil deleted the fix/sibling-loading-without-debug branch October 18, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug 🐛 Issues related to bugs, errors, or mistakes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant