nomnoml
nomnoml copied to clipboard
Allow Unicode escapes to be used in nomnoml code chunks.
This SO question: https://stackoverflow.com/q/72271331/2554330 had a user who wanted to include Greek letters specified using Unicode escapes in labels in a nomnoml diagram.
This PR allows this, by parsing the code in the nomnoml code chunk to get R to process Unicode chars, unless escape = TRUE
is used as a chunk option, in which case the backslash will be passed through to the widget, where it will be displayed without processing.
The name of the option matches the name used in knitr::kable
, but the default is the opposite here: using Unicode escapes seems like a reasonable thing to do, whereas wanting backslashes in the output seems uncommon.
The tests don't currently pass on my system, because of unrelated issues in the Shiny tests.
Many thanks, @dmurdoch.
I'm working through this PR now.
I have merged this PR in my local workflow. Thank you for contributing.
Re-opening, since in my local testing the unicode doesn't render properly. I'll investigate why.