d1621dca
fix(prosediff): an equal run's separator comes from whichever side has one (spec-by6.5)
spans() read Span.Space off toks[0], and for an equal run those tokens come
from the old side. An equal run exists in both revisions at once, and the two
sides can disagree about what precedes it: a block that gains words at its head
has nothing before its first old token and the insertion before its first new
one. The script then said Space=false and a renderer joining the spans wrote
"{+in practice+}the storage layer" with the words run together — a defect the
reader would read as the author's, because nothing in the output says a
separator went missing.
Not reachable from the review page today: web/diffrows.go's sideSpans already
carries a dropped span's separator onto the next kept one, and the per-line
merge never joins two spans across that boundary. It was wrong in the data all
the same, and the next consumer of the script would have inherited it.
Passing the flag into emit rather than deriving it also drops the
write-back that reached into out[len(out)-1] to clear a substitution's
separator, which would have edited the wrong span had emit ever skipped an
empty run.
Eugene Blikh <bigbes@gmail.com> — 2026-08-05 01:23:08 UTC
Commit d1621dca89d49b047348971fb9a682b232e19a26 —
view raw patch
Parent(s):
f42f81ca
| File | Status | + | − |
|---|---|---|---|
prosediff/token.go
|
M | +17 | -9 |
prosediff/token_test.go
|
M | +32 |