mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-27 04:50:43 +00:00
interpolate: escape backticks
This commit is contained in:
parent
3bcaaf408b
commit
cf0a1a3a3f
@ -6,7 +6,9 @@ function addScript(url) {
|
||||
|
||||
function interpolate(str, params) {
|
||||
try {
|
||||
return eval(`env => { with (env) { return \`${str}\` } }`)(params)
|
||||
return eval(
|
||||
`env => { with (env) { return \`${str.replace(/`/, '\\`'}\` } }`
|
||||
)(params)
|
||||
} catch (e) {
|
||||
return e.message;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user