Escape \ in enum edit

This commit is contained in:
Jakub Vrana 2018-05-06 19:17:35 +02:00
parent 659c34f7c5
commit 6f25b1b5cf

View file

@ -428,7 +428,7 @@ function enumValues(s) {
function editingLengthBlur() { function editingLengthBlur() {
var field = this.parentNode.firstChild; var field = this.parentNode.firstChild;
var val = this.value; var val = this.value;
field.value = (/^'[^\n]+'$/.test(val) ? val : val && "'" + val.replace(/\n+$/, '').replace(/'/g, "''").replace(/\n/g, "','") + "'"); field.value = (/^'[^\n]+'$/.test(val) ? val : val && "'" + val.replace(/\n+$/, '').replace(/'/g, "''").replace(/\\/g, '\\\\').replace(/\n/g, "','") + "'");
field.style.display = 'inline'; field.style.display = 'inline';
this.style.display = 'none'; this.style.display = 'none';
} }