nomnoml icon indicating copy to clipboard operation
nomnoml copied to clipboard

Allow Unicode escapes to be used in nomnoml code chunks.

Open dmurdoch opened this issue 2 years ago • 1 comments

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.

dmurdoch avatar May 17 '22 13:05 dmurdoch

The tests don't currently pass on my system, because of unrelated issues in the Shiny tests.

dmurdoch avatar May 17 '22 13:05 dmurdoch

Many thanks, @dmurdoch.

I'm working through this PR now.

andrie avatar Mar 07 '23 16:03 andrie

I have merged this PR in my local workflow. Thank you for contributing.

andrie avatar Mar 08 '23 07:03 andrie

Re-opening, since in my local testing the unicode doesn't render properly. I'll investigate why.

Uploading image.png…

andrie avatar Mar 08 '23 07:03 andrie