View source: R/template-variables.R
| js_str | R Documentation |
Rendered templates place configuration strings between single quotes in
JavaScript, both in main.js and in the inline <script> of
lifecycle.html, as in title: 'Close {{{app_name_js}}}'. This escapes
backslashes and then single quotes, turns carriage returns and line feeds
into spaces, and writes U+2028, U+2029, and every < as escape sequences
(< becomes \u003C). No value can then end the literal early, change
its meaning (a Windows path keeps its backslashes), or end or disturb an
HTML <script> block. Double quotes are left alone, so use the result
only inside single quotes.
js_str(x)
x |
A character vector, a non-character scalar (coerced with
|
Render the result with a triple mustache ({{{name_js}}}). A double
mustache would HTML-escape it again and turn & into &. HTML
markup, such as the page title in lifecycle.html, keeps the double
mustache.
A character vector, or NULL when x is NULL.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.