editor: don't eat backslashes in enquoted strings (#515)
This commit is contained in:
parent
b65d7ecb0f
commit
18d1735c01
2 changed files with 6 additions and 0 deletions
|
|
@ -103,6 +103,11 @@ module.exports = function editField(editor, widget, propName, defaultValue){
|
|||
|
||||
try {
|
||||
v = JSON.parseFlex(input.value)
|
||||
if (typeof v === 'string') {
|
||||
// escape backslashes in simple strings only
|
||||
v = JSON.parseFlex(input.value.replace(/\\/g, '__BACKSLASH__'))
|
||||
v = v.replace(/__BACKSLASH__/g, '\\')
|
||||
}
|
||||
} catch(err) {
|
||||
v = input.value
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue