Opened 12 years ago
Last modified 15 months ago
#10813 new defect
diff view (tabular) whitespace off-by-one mistake
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | next-stable-1.6.x |
Component: | version control/changeset view | Version: | 1.0dev |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I have made a commit that looks like the following:
-
(a) a vs. (b) b
a b 12 12 return ( stricmp(cpname, "utf-8" ) == 0 ) ? CP_UTF8 13 13 : ( stricmp(cpname, "euc-kr" ) == 0 ) ? CP_EUCKR 14 14 :
It was to fix a whitespace typo where my editor put in two tabs instead of a tab and five spaces. Now, when I view the revision in the changeset view using 'tabular' mode, the + part of the diff is missing one space and the : is no longer aligned with the line above.
I did some tests with the generated html code, and the cause is the following snippet:
<span><ins> </ins> :</span>
compare that to the html generated in this ticket view:
<span><ins> </ins>:</span>
In the changeset view, trac generates the missing blank space outside of the <ins> segment, but that area is not pre-formatted and so the space is discarded by the browser. And even if it wasn't, it would still be colored wrong. What's also weird is the alternating chain of and spaces, instead of just packed together (is this filesize optimization?).
Note that the 'unified' mode does not suffer from this issue as it seems to be taking this off-by-one issue into account and compensating for it. PS: I believe this issue has existed for years.
Attachments (0)
Change History (5)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Milestone: | → next-stable-1.0.x |
---|
comment:3 by , 8 years ago
Milestone: | next-stable-1.0.x → next-stable-1.2.x |
---|
Moved ticket assigned to next-stable-1.0.x since maintenance of 1.0.x is coming to a close. Please move the ticket back if it's critical to fix on 1.0.x.
comment:4 by , 5 years ago
Milestone: | next-stable-1.2.x → next-stable-1.4.x |
---|
For reference, it looks like this in today's trunk (because of the incorrectly generated html):
(a) a vs. (b) b