mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-07 13:15:00 -05:00
Escape newline chars in conditionalPanel expr. Fixes #1818
This commit is contained in:
@@ -161,7 +161,11 @@ function pixelRatio() {
|
||||
// "with" on the argument value, and return the result.
|
||||
function scopeExprToFunc(expr) {
|
||||
/*jshint evil: true */
|
||||
var expr_escaped = expr.replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0');
|
||||
var expr_escaped = expr
|
||||
.replace(/[\\"']/g, '\\$&')
|
||||
.replace(/\u0000/g, '\\0')
|
||||
.replace(/\n/g, '\\n');
|
||||
|
||||
try {
|
||||
var func = new Function(
|
||||
`with (this) {
|
||||
|
||||
Reference in New Issue
Block a user