Defect #9143
closedPartial diff comparison should be done on actual code, not on html
0%
Description
Semicolons were mysteriously appearing in code diffs in the repository, but only when viewed in Redmine. Upon investigation, it became clear that this is because the semicolon was not part of the diff, but was just after it. Since part of the line that changed is enclosed in <span> tags, when the change ends in the old and new versions with distinct HTML special chars, the semicolon terminating the special chars is treated as if it hadn't changed.
Observe, in the example below, how > and & should each be treated as a single unit, but is instead handled one char at a time, making it appear that ">" became "&" and that the ";" didn't change.
<tr>
<th class="line-num">47</th>
<th class="line-num"></th>
<td class="line-code diff_out">
<pre>void DoSomething(<span>std::auto_ptr<MyClass></span>; myObj)
</pre>
</td>
</tr>
<tr>
<th class="line-num"></th>
<th class="line-num">47</th>
<td class="line-code diff_in">
<pre>void DoSomething(<span>const MyClass&</span>; myObj)
</pre>
</td>
</tr>
I suspect this is a result of the fact that the code in the repository is first rendered as html, and then passed to the engine that analyzes where the changes are. This should be done in the opposite order.
Related issues