Closed gvelasq closed 11 months ago
Thanks for the detailed issue!
We're using innerHTML
instead of innerText
to update the document for output to provide annotation to differentiate between STDOUT
and STDERR
(black/red text). Specifically, we're doing it at:
This likely requires a modification in the mapping code to return output as an untouched HTML element.
We do not have any of the built-in Quarto code cell options yet. That's why you're seeing the output: 'asis'
not change anything.
@gvelasq thanks again for the detailed report. I've merged in a fix (#116) alongside a new test case.
https://quarto-webr.thecoatlessprofessor.com/tests/qwebr-test-escape-html-output-characters.html
Please update to the latest development version by typing into Terminal while in the Quarto's project working directory:
quarto add coatless/quarto-webr
Thank you so much, @coatless ! 🎉
@coatless we really appreciate your prompt reply and fix!
Just an FYI @gvelasq & @ivelasq, in #141 some features of results
(not output
) are now available.
>>> There would be no changes required if you update to the PR/future version. <<<
For those who stumble upon this issue ticket, if you wanted to allow for the original behavior of having the text become a hyperlink, then this is now possible by specifying inside the code cell: results: 'asis'
Bug description
Thank you for this excellent extension. @ivelasq and I are planning to use it for her Quarto blog. When running the following code in a webR code cell in a Quarto HTML document, the output is automatically rendered into a live hyperlink, which is unexpected behavior. The desired behavior is for the HTML code (not the live hyperlink) to be displayed as output, as it is in the 1) R console in RStudio, 2) in the webR REPL demo, 3) the webR website's interactive console, or in 4/5) .qmd/.Rmd files that are rendered/knit in RStudio.
Steps to reproduce
Rather than the output of the code cell being a line of HTML code created by
writeLines(noquote(paste0(...)))
, the output is instead a clickable hyperlink to the Posit website. Ideally, there could be a option (at the code chunk level, not at the YAML header level) to disable/enable this behavior. We tried#| output: asis
but that did not work.Below for reference are examples that do display the expected behavior:
(Expected) Copy/paste the code above into the webR REPL demo:
(Expected) Copy/paste the code above into the webR website's interactive console:
(Expected) Copy/paste the code above into a blank .qmd and render the document:
(Expected) Copy/paste the code above into a blank .Rmd and knit the document:
Your environment
Quarto check output