mirror of
https://github.com/yawaflua/yaflay.ru.git
synced 2026-02-04 10:54:12 +02:00
set replace " to \" and newline to "\\n"
This commit is contained in:
@@ -12,9 +12,9 @@ function updateAnnotation(value) {
|
|||||||
function sendArticleData () {
|
function sendArticleData () {
|
||||||
let melon = document.cookie.split(';')[0].replace("melon=", "");
|
let melon = document.cookie.split(';')[0].replace("melon=", "");
|
||||||
let body = `{
|
let body = `{
|
||||||
title: "${$("#titleInput").val()}",
|
title: "${$("#titleInput").val().replace(/"/g, '\\"') }",
|
||||||
annotation: "${$("#annotationArea").val()}",
|
annotation: "${$("#annotationArea").val().replace(/\t/g, '\r\n').replace(/"/g, '\\"') }",
|
||||||
text: "${$("#textArea").val()}",
|
text: "${$("#textArea").val().replace(/\t/g, '\r\n').replace(/"/g, '\\"') }",
|
||||||
image: "${$("#imgInput").val()}",
|
image: "${$("#imgInput").val()}",
|
||||||
author: "${melon}"
|
author: "${melon}"
|
||||||
}`
|
}`
|
||||||
|
|||||||
Reference in New Issue
Block a user