https://bugzilla.wikimedia.org/show_bug.cgi?id=54328

--- Comment #1 from Brad Jorsch <bjor...@wikimedia.org> ---
The data structure would have to be rather more complicated than that. At first
guess, something along the lines of (in JSON):

 "diff": [
     { "line": 1, "type": "context", "content": "Line" },
     { "line": 2, "type": "removed", "old": "Line" },
     { "line": 2, "type": "added", "new": "Line" },
     { "line": 3, "type": "context", "content": "Line" },
     { "line": 47, "type": "context", "content": "Line" },
     { "line": 48, "type": "changed", "old": "Line", "new": "Line" },
     { "line": 49, "type": "context", "content": "Line" }
 ]

If you want indication in the line of what changed for "changed" types, that's
another complication. Instead of just "Line" it would have to be an array of
fragments. One simple way might be that even array indexes are unchanged and
odd are changed:

   "old": [
       "foo bar ",
       "",
       "quux ",
       "poop",
   ],
   "new": [
       "foo bar ",
       "baz ",
       "quux ",
       "etc.",
   ]

That might indicate that "baz" was inserted into the list and "poop" at the end
was replaced with "etc.". Or maybe it would be better to combine "old" and
"new" into one datastructure somehow.

Also, keep in mind that lots of little objects can use a surprising amount of
memory (see bug 53663).

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to