replace carriage returns client side
This commit is contained in:
@@ -27,7 +27,14 @@ function upsert() {
|
||||
function jsonifyForm(id) {
|
||||
var form = document.getElementById(id)
|
||||
var entries = new FormData(form).entries();
|
||||
var json = Object.assign(...Array.from(entries, ([x,y]) => ({[x]:y})));
|
||||
var json = Object.assign(...Array.from(
|
||||
entries,
|
||||
([x,y]) => ({
|
||||
[x]:y
|
||||
.replace(/\r\n/g, '\n')
|
||||
.replace(/\r/g, '\n')
|
||||
})
|
||||
))
|
||||
json.disabled = json.disabled == "false"
|
||||
var s = JSON.stringify(json)
|
||||
return s
|
||||
|
||||
Reference in New Issue
Block a user