You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a486b88, we documented that disabling the eagerCache Lua option can lead to undefined behavior when markdown fragments are nested. However, this is not always true: disabling the eagerCache Lua option only causes undefined behavior when \markdownMode is set to the legacy values 0 (shell escape via \write18) and 1 (shell escape via os.execute()), not 2 (direct Lua access). Furthermore, we can detect nested markdown fragments and avoid undefined behavior: If we are in a nested context and \markdownMode is 2, then we disable eagerCache and redirect output from \markdownOptionOutputTempFileName to a new type of a temporary output file.
The text was updated successfully, but these errors were encountered:
Perhaps a simpler solution that leverages the semantics of files on unix: Currently, we open outputTempFileName for writing, which truncates the file, affecting all file descriptors open for reading. However, if we first unlinked the file from outputTempFileName and then opened outputTempFileName for writing, a new file would be created and the original should be garbage-collected after the end of the process, making any conflict between the two different files impossible.
This issue will be solved when Witiko/lt3luabridge#8 has been closed and after we have removed \markdownMode in #309. Then, we can remove the undefined behavior notice and make eagerCache=false the default behavior.
In a486b88, we documented that disabling the
eagerCache
Lua option can lead to undefined behavior when markdown fragments are nested. However, this is not always true: disabling theeagerCache
Lua option only causes undefined behavior when\markdownMode
is set to the legacy values 0 (shell escape via\write18
) and 1 (shell escape viaos.execute()
), not 2 (direct Lua access). Furthermore, we can detect nested markdown fragments and avoid undefined behavior: If we are in a nested context and\markdownMode
is 2, then we disableeagerCache
and redirect output from\markdownOptionOutputTempFileName
to a new type of a temporary output file.The text was updated successfully, but these errors were encountered: