Steps to reproduce: visit https://en.wikipedia.org/wiki/Special:MobileDiff/965624274 and scroll past the infobox to the opening paragraph.
Actual results: See screenshot
. When there are sequential words that are changed, every space between words is considered "unchanged." This slices up the diff'd section, making the MobileDiff nearly unreadable (in terms of sentence-level reading comprehension).Expected results: <red>active in the [[conservation (ethic)|conservation]],</red> <green>that has raised more than</green>
Bug fix/feature request:
Change the logic so that the change "eat food" -> "drink water" is treated as a single changed fragment, without the " " being recognized as an unchanged section, while preserving the behavior of "eat some food" -> "drink some water", in which " some " is recognized as unchanged.
This will be a tweak to the logic that treats words as indivisible chunks - e.g. if "ten" is changed to "hundred", you don't see the "e" treated as "unchanged".
If the MediaWiki code is explicitly identifying the fragments of text which are considered "unchanged," then this should be a very simple fix:
A) require an unchanged fragment to be >1 character long
B) require an unchanged fragment to be something like "\s+\S+\s+", i.e. whitespace, non-whitespace, whitespace.
If the MediaWiki code only explicitly identifies *changed* fragments, then it should, afterward, scan through the gaps between them - the *unchanged* fragements - and in the above cases (A and B), merge the surrounding changed fragments into one, i.e. merge "eat"," ","food" -> "eat food" as the single changed fragment.