I am developing an app that the user send text to the server. Then the server change the text, and respond with the original text and the modified text.
How to represent text that deleted in JSON. (strike-through)
For example like so:
I thought about something like that:
Array that contain all the text, splited to where to contain stroke, and where not:
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'}
]
}
Do you have any better idea?
Or like this:
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},
]
changethe text` *real world data* ? – F. Hauri - Give Up GitHub Feb 15 '16 at 10:05