Closed
Description
- Gitea version (or commit ref): try.gitea.io or codeberg.org
- Operating system: Debian GNU/Linux 10 (Buster)
- Yes, @6543 could reproduce the bug at https://try.gitea.io/6543/vturn_server/commit/8d672a398f22ea465edd42a6d9de7cd2e88c7ab5
Description
First reported on https://codeberg.org/Codeberg/Community/issues/374
I found a display issue in this commit diff view: https://codeberg.org/eventbike/vturn_server/commit/8d672a398f22ea465edd42a6d9de7cd2e88c7ab5 (main.v, line 27)
Displayed line:
run(dban class="o">)
Actual file content:
run(db)
HTML code at this is point:
<td class="lines-code lines-code-new halfwidth add-code"><span class="mono wrap"> <span class="n">run</span><span class="added-code"><span class="o">( </span><span class="n">d</span>b</span> <sp<span class="added-code">an class="o</sp<span></span>">)</td>
Screenshots
Thank you a lot.
Activity
bagasme commentedon Jan 5, 2021
@fnetX i see that for your case as noted by your screenshot, the wrong color for brackets at
run()
.fnetX commentedon Jan 5, 2021
You mean the brackets have the wrong colour? Yes, but that's because the whole HTML is messed up here.
zeripath commentedon Jan 5, 2021
will add a testcase to work with
zeripath commentedon Jan 6, 2021
the diffRecord is:
zeripath commentedon Jan 6, 2021
I honestly think the regexp approach cannot work here.
Record 2 here is an attribute in deleted case and is text in added case.
zeripath commentedon Jan 6, 2021
In my previous reverted pr I attempted to do the kind of necessary fixup.
Now, we have several options:
zeripath commentedon Jan 9, 2021
thinking on here - I think the fixup technique is the correct answer.
Intention of the proposed algo - No Equals/Insert/Delete block starts or ends within an element, entity or even within an unclosed span. (EDIT: this last case needs a bit more thought)
I think that would do it.
Fix broken spans in diffs (#14678)
fnetX commentedon Feb 14, 2021
@zeripath Thank you!
Fix broken spans in diffs (go-gitea#14678)
zeripath commentedon Feb 14, 2021
@fnetX Sorry it's taken so long. It was unfortunately a non-trivial bug.
zeripath commentedon Feb 14, 2021
I should also add I was significantly delayed by breaking my left hand over the Christmas period.
Fix broken spans in diffs (#14678) (#14683)