Skip to content

user filters need to access _G #5466

@albert-ying

Description

@albert-ying

Bug description

The new version breaks the zotero.lua, which is a popular lua filter that allows to link citation to zotero in Word output.

Yaml:

---
title: '****'
author: 'NA'
format:
  docx:
    reference-doc: manuscript_style.docx
bibliography: /Users/A.Y/OneDrive - Harvard University/My Library.bib
csl: /Users/A.Y/Zotero/styles/nature.csl
filters: 
 - zotero.lua
---

Error running filter /Applications/quarto/share/filters/main.lua:
zotero.lua:70: attempt to index a nil value (global '_G')
stack traceback:
        [C]: in upvalue 'orig_require'
        [string "..."]:1353: in function 'require'
        zotero.lua:1716: in local 'chunk'
        /Applications/quarto/share/filters/main.lua:4073: in local 'callback'
        [string "..."]:1789: in function <[string "..."]:1787>
        (...tail calls...)
        /Applications/quarto/share/filters/main.lua:368: in function 'make_wrapped_user_filters'
        /Applications/quarto/share/filters/main.lua:15395: in main chunk

See also this issue retorquere/zotero-better-bibtex#2497

And here #1206

Any idea how could I make it work again?

On MacOS, Quarto 1.3340

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.
  • Please provide the output of quarto check so we know which version of quarto and its dependencies you're running.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backportbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions