mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 06:55:46 +00:00
ui: util: add helpers for (un)escaping notes-template
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
e01438a744
commit
7c8ff459a8
@ -1784,6 +1784,22 @@ Ext.define('PVE.Utils', {
|
|||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
escapeNotesTemplate: function(value) {
|
||||||
|
let replace = {
|
||||||
|
'\\': '\\\\',
|
||||||
|
'\n': '\\n',
|
||||||
|
};
|
||||||
|
return value.replace(/(\\|[\n])/g, match => replace[match]);
|
||||||
|
},
|
||||||
|
|
||||||
|
unEscapeNotesTemplate: function(value) {
|
||||||
|
let replace = {
|
||||||
|
'\\\\': '\\',
|
||||||
|
'\\n': '\n',
|
||||||
|
};
|
||||||
|
return value.replace(/(\\\\|\\n)/g, match => replace[match]);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
singleton: true,
|
singleton: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user