Я разрабатываю приложение, которое пользователь отправляет текст на сервер. Затем сервер меняет текст и отвечает исходным текстом и измененным текстом.
Как представить удаленный текст в JSON. (зачеркнутый)
Например так:
Я думал о чем-то подобном:
Массив, содержащий весь текст, разделенный на то, где должен содержаться штрих, а где нет:
data={
textBefore:'this is the first world. this is the second world',
textAfter:'this is first world. this is second world,
changes:[
{'nostroke':'this is th'},
{'stroe':'efirst world'},
{'nostroke':'in the third world'}
]
}
У вас есть идея получше?
Или вот так:
data={
textBefore:'this is the first world. this is the second world',
textAfter:'this is first world. this is second world,
changes:[
{from:2,to:22,text:'repace from char 2 to char 22 with this text'},
{from:2,to:4} // This will only delete 2 chars
{from:2,to:2,text:'This will only append this text without replae},
]
Then the server <s>change</s> the text
реальными данными? - person F. Hauri   schedule 15.02.2016