Rapporter / pander

An R Pandoc Writer: Convert arbitrary R objects into markdown
http://rapporter.github.io/pander/
Open Software License 3.0
294 stars 66 forks source link

Preserve src formatting in evals #369

Closed seanbirchall closed 7 months ago

seanbirchall commented 7 months ago

I've made a small R repl app which heavily uses pander evals. I'm wondering if there is anyway to preserve the src formatting of txt, right now it removes all \n.

In the below screenshot I'm using shinyAce which returns a character string formatted as it appears in the editor, I then pass all code run in shinyAce to evals, below the editor is non-interactive console where you can see I return evals[[x]][["src"]] which removes the formatting.

evals

daroczig commented 7 months ago

Did you check if the parse argument of evals helps in your use case?

seanbirchall commented 7 months ago

I did but the wording of it made me believe it wouldn't give me the results I'm looking for... I was wrong. parse = FALSE does exactly what I want, thank you @daroczig.

daroczig commented 7 months ago

awesome, thanks for reporting back

daroczig commented 7 months ago

oh, and feel free to create a PR to improve the wording of that param .. it was written ~10 yrs ago with my limited English skills 🤐