#12773 closed defect (fixed)
Wrong diff text is shown after switching to "Unified"
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.3.2 |
Component: | wiki system | Version: | 1.3dev |
Severity: | normal | Keywords: | diff |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Fixed extra spaces in each title of diff block. |
Description (last modified by )
This issue is able to confirm at comment:description:ticket:12768.
@@ -810,11 +810,12 @@
and class Chrome(Component):
should be shown in the same line but not. Also, the unified diff text is corrupted.
Attachments (2)
Change History (9)
by , 8 years ago
Attachment: | diff-tabluar.png added |
---|
by , 8 years ago
Attachment: | diff-unified.png added |
---|
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
comment:2 by , 8 years ago
Description: | modified (diff) |
---|
follow-up: 7 comment:3 by , 7 years ago
comment:4 by , 7 years ago
Keywords: | diff added |
---|---|
Milestone: | next-dev-1.3.x → 1.3.2 |
Owner: | set to |
Status: | new → assigned |
It is caused by that item.diffs_title
are rendered with extra spaces in Jinja2 template at source:/trunk/trac/templates/diff_div.html@15484:182-187,310-315#L182.
But item.diffs_title
are rendered without extra spaces within an em
element. We could easily retrieve text from the em
element rather than the cell.
diff --git a/trac/htdocs/js/diff.js b/trac/htdocs/js/diff.js index a54d72ee5..c27f0c95d 100644 --- a/trac/htdocs/js/diff.js +++ b/trac/htdocs/js/diff.js @@ -25,7 +25,7 @@ var oldOffset = 0, oldLength = 0, newOffset = 0, newLength = 0; var title = ""; if (inline) - title = $(ths[2]).text(); + title = $('em', ths[2]).text(); for (var i = 0; i < table.tBodies.length; i++) { var tBody = table.tBodies[i]; @@ -43,7 +43,7 @@ oldOffset = 0, oldLength = 0, newOffset = 0, newLength = 0; if (tBody.className == "skipped") { if (inline) - title = $(tBody.rows[0].cells[2]).text(); + title = $('em', tBody.rows[0].cells[2]).text(); continue; } }
comment:5 by , 7 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Fixed in [16158].
comment:6 by , 5 years ago
Release Notes: | modified (diff) |
---|
comment:7 by , 5 years ago
Replying to Jun Omae:
I encountered this issue again. Notes that trunk only has the issue but 1.2-stable works fine.
Moving Release Notes to Internal Changes since this didn't affect stable releases.
I encountered this issue again. Notes that trunk only has the issue but 1.2-stable works fine.