jgm / pandoc

Universal markup converter
https://pandoc.org
Other
33.14k stars 3.3k forks source link

Lua: keep `lpeg` and `re` as "loaded" modules. #9922

Closed tarleb closed 2 days ago

tarleb commented 3 days ago

The modules lpeg and re are now treated as if they had been loaded with require. Previously the modules were only assigned to global values, but could be loaded again via require, thereby allowing to use a system-wide installation. However, this proved to be too confusing.

The old behavior can be restored by adding the following lines to the top of Lua scripts, or to the init.lua in the data dir.

debug.registry()['_LOADED'].lpeg = nil
debug.registry()['_LOADED'].re = nil
cscheid commented 2 days ago

Oh, this is quite nice, thank you! It will allow Quarto to remove some of the workarounds we've had to add around this.