Edgewall Software
Modify

Opened 6 years ago

Last modified 6 years ago

#7486 new defect

wrong space in diff output

Reported by: moo Owned by:
Priority: normal Milestone: next-minor-0.12.x
Component: version control/changeset view Version: 0.11-stable
Severity: normal Keywords: diff space
Cc: phpxcache@…
Release Notes:
API 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 (5)

comment:1 Changed 6 years ago by ebray <hyugaricdeau@…>

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 Changed 6 years ago by moo

"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 Changed 6 years ago by moo

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 Changed 6 years ago by anonymous

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 Changed 6 years ago by cboos

  • Keywords diff added
  • Milestone changed from 0.11.2 to 0.11.3

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new The ticket will remain with no owner.
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'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.