Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions package/scripts/windows/quarto.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,31 @@ SET "DENO_TLS_CA_STORE=system,mozilla"
SET "DENO_NO_UPDATE_CHECK=1"
SET "QUARTO_DENO_OPTIONS=--unstable-ffi --no-config --cached-only --allow-read --allow-write --allow-run --allow-env --allow-net --allow-ffi"

REM --enable-experimental-regexp-engine is required for /regex/l, https://github.com/quarto-dev/quarto-cli/issues/9737
REM Add expected V8 options to QUARTO_DENO_V8_OPTIONS
IF DEFINED QUARTO_DENO_V8_OPTIONS (
SET "QUARTO_DENO_V8_OPTIONS=--enable-experimental-regexp-engine,--max-old-space-size=8192,--max-heap-size=8192,!QUARTO_DENO_V8_OPTIONS!"
REM --enable-experimental-regexp-engine is required for /regex/l, https://github.com/quarto-dev/quarto-cli/issues/9737
IF "!QUARTO_DENO_V8_OPTIONS!"=="!QUARTO_DENO_V8_OPTIONS:--enable-experimental-regexp-engine=!" (
SET "QUARTO_DENO_V8_OPTIONS=--enable-experimental-regexp-engine,!QUARTO_DENO_V8_OPTIONS!"
)
IF "!QUARTO_DENO_V8_OPTIONS!"=="!QUARTO_DENO_V8_OPTIONS:--max-old-space-size=!" (
SET "QUARTO_DENO_V8_OPTIONS=--max-old-space-size=8192,!QUARTO_DENO_V8_OPTIONS!"
)
IF "!QUARTO_DENO_V8_OPTIONS!"=="!QUARTO_DENO_V8_OPTIONS:--max-heap-size=!" (
SET "QUARTO_DENO_V8_OPTIONS=--max-heap-size=8192,!QUARTO_DENO_V8_OPTIONS!"
)
) ELSE (
SET "QUARTO_DENO_V8_OPTIONS=--enable-experimental-regexp-engine,--max-old-space-size=8192,--max-heap-size=8192"
)

REM Prepend v8-flags for deno run if necessary
IF NOT DEFINED QUARTO_DENO_EXTRA_OPTIONS (
SET "QUARTO_DENO_EXTRA_OPTIONS=--v8-flags=!QUARTO_DENO_V8_OPTIONS!"
) ELSE (
SET "QUARTO_DENO_EXTRA_OPTIONS=--v8-flags=!QUARTO_DENO_V8_OPTIONS! !QUARTO_DENO_EXTRA_OPTIONS!"
IF "!QUARTO_DENO_EXTRA_OPTIONS!"=="!QUARTO_DENO_EXTRA_OPTIONS:--v8-flags=!" (
SET "QUARTO_DENO_EXTRA_OPTIONS=--v8-flags=!QUARTO_DENO_V8_OPTIONS! !QUARTO_DENO_EXTRA_OPTIONS!"
) ELSE (
ECHO WARN: QUARTO_DENO_EXTRA_OPTIONS already contains --v8-flags, skipping addition of QUARTO_DENO_V8_OPTIONS by quarto itself. This is unexpected and you should check your configuration.
)
)

!QUARTO_DENO! !QUARTO_ACTION! !QUARTO_DENO_OPTIONS! !QUARTO_DENO_EXTRA_OPTIONS! !QUARTO_IMPORT_MAP_ARG! !QUARTO_TARGET! %*
Expand Down
17 changes: 12 additions & 5 deletions src/resources/filters/normalize/parsehtml.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,21 @@ function parse_html_tables()
jin:write(htmltext)
jin:flush()
local quarto_path = pandoc.path.join({os.getenv('QUARTO_BIN_PATH'), 'quarto'})
local jout = io.popen(quarto_path .. ' run ' ..
local jout, jerr = io.popen(quarto_path .. ' run ' ..
pandoc.path.join({os.getenv('QUARTO_SHARE_PATH'), 'scripts', 'juice.ts'}) .. ' ' ..
juice_in, 'r')
if jout then
return jout:read('a')
else
quarto.log.error('failed to juice')
if not jout then
quarto.log.error('Running juice failed with message: ' .. (jerr or "Unknown error"))
return htmltext
end
local content = jout:read('a')
local success, _, exitCode = jout:close()
-- Check the exit status
if not success then
quarto.log.error("Running juice failed with exit code: " .. (exitCode or "unknown exit code"))
return htmltext
else
return content
end
end)
end
Expand Down