Edgewall Software
Modify

Opened 16 years ago

Last modified 7 months ago

#7486 new defect

wrong space in diff output

Reported by: moo Owned by:
Priority: normal Milestone: next-stable-1.6.x
Component: version control/changeset view Version: 0.11-stable
Severity: normal Keywords: diff space
Cc: phpxcache@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

i'm not sure if this applies to other mimetype syntax highligher

See URL: http://linuxfire.com.cn/BadGirl/changeset/290

the new "num0_254" is EXPECTED to be align to num1_254 but it is ACTUALLY 1 char off and align to "("

actual code output:

                        <th>114</th><th> </th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <del>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </del> num0_254,</span> </td>

expected code output

                        <th>114</th><th> </th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <del>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </del>&nbsp;num0_254,</span> </td>

please note the difference is, "</del> " is changed to "</del>&nbsp;"

tech reason: although space following &nbsp; is recognized as space, e.g.: "&nbsp; " is same as "&nbsp;&nbsp;", but space following the "<tag>" is not. "</del> " should be escape as "</del>&nbsp;"

Attachments (0)

Change History (9)

comment:1 by ebray <hyugaricdeau@…>, 16 years ago

I don't understand why you think there should be an &nbsp; after the </del> tag. The only spaces that ought to be displayed are the ones that were deleted. And FF3 anyways seems to be rendering the correct number of spaces. Not sure exactly why there's a space after the </del> tag, but it's harmless.

comment:2 by moo, 16 years ago

"The only spaces that ought to be displayed are the ones that were deleted"

neither FF3 or IE is rendering the correct number of spaces here.

i'm not sure how the diff algo works. but i'm sure about the space after ">", it's never rendered

{{{
#!html
<span style="background:red;color:white"> a</span><br>
<span style="background:red;color:white">&nbsp;a</span>
}}}

rendered as:

a
 a

if you need the space after "</del>", escape it as "&nbsp;", if you think the space shouldn't be there, simply remove it instead of rely on the mystery browser bahavoir.

comment:3 by moo, 16 years ago

btw, u can download the unidiff from http://linuxfire.com.cn/BadGirl/changeset/290?format=diff&new=290 and render it in your local trac

u can also highlight tab by "/<TAB>" (search for tab) in vim and u'll see the tab changes. i suppose the tab/space changes explains the reason why there is space after </del>

btw, not just space after ">" but also space at line begining like

{{{
#!html
<div style="font-family: mono, monospace">
- no space
 - one space<br>
&nbsp;- one nbsp<br>
&nbsp; - one nbsp and a space<br>
 &nbsp; - one space and a nbsp<br>
</div>
}}}

is rendered as

- no space - one space
 - one nbsp
  - one nbsp and a space
 - one space and a nbsp

you think they're same rendered, they're not

i forgot to add monospace to the "<span> a</span>" example, here we go:

{{{
#!html
<span style="background:red;color:white; font-family: mono, monospace"> a</span><br>
<span style="background:red;color:white; font-family: mono, monospace">&nbsp;a</span>
}}}

rendered as

a
 a

comment:4 by anonymous, 16 years ago

oops, forgot a <br>

{{{
#!html
<div style="font-family: mono, monospace">
* no space<br>
 - one space<br>
* no space<br>
&nbsp;- one nbsp<br>
* no space<br>
&nbsp; - one nbsp and a space<br>
* no space<br>
 &nbsp;- one space and a nbsp<br>
* no space<br>
</div>
}}}

is rendered as

* no space
- one space
* no space
 - one nbsp
* no space
  - one nbsp and a space
* no space
 - one space and a nbsp
* no space

sorry for the spam/noisy

comment:5 by Christian Boos, 16 years ago

Keywords: diff added
Milestone: 0.11.20.11.3

comment:6 by Ryan J Ollos, 9 years ago

Milestone: next-minor-0.12.xnext-stable-1.0.x

comment:7 by Ryan J Ollos, 7 years ago

Milestone: next-stable-1.0.xnext-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:8 by Ryan J Ollos, 4 years ago

Milestone: next-stable-1.2.xnext-stable-1.4.x

comment:9 by Ryan J Ollos, 7 months ago

Milestone: next-stable-1.4.xnext-stable-1.6.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.