Last modified: 2014-02-15 21:43:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30988, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28988 - html of table.diff cells contains terminal white-space not in source text
html of table.diff cells contains terminal white-space not in source text
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
History/Diffs (Other open bugs)
1.20.x
All All
: Low normal (vote)
: ---
Assigned To: Brion Vibber
:
Depends on: 27720
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-15 04:30 UTC by Thana
Modified: 2014-02-15 21:43 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Thana 2011-05-15 04:30:26 UTC
i set this in my personal css to make my diff view resemble the editform,
namely to make the number and type of spaces apparent in each line.
> .diff-addedline, .diff-deletedline, .diff-context
>     { font-family:monospace; white-space:pre-wrap; }

but i did not count on the html of these cells containing superfluous carriage
returns and spaces. due to my css, the \n's became visible as blank lines at
the start and end of each cell and two extra spaces appeared at the end.

i.e. "CONTENT" is represented as "\nCONTENT\n  ".

see, the outputted html looks like this:
>   <td class="diff-deletedline"><div>
> FIVE→     ←SPACES
>   </div></td>

whereas the following would be ideal:
>   <td class="diff-deletedline"><div>FIVE→     ←SPACES</div></td>

of course, all white-space actually present in each line of wiki-text should
remain so.

(i don't know the purpose of adding a div tag with no attributes to each cell,
but that's another matter.)
Comment 1 Brion Vibber 2011-05-15 09:41:00 UTC
The div is there to make the CSS overflow work, so the table doesn't get pushed wider than the screen when there are very long lines.

The spaces seem to just be general HTML pretty-printing indentation, which you'll find in many many places (but not always consistently). This may also depend on which diff engine is producing the diff, and whether or how tidy is being used.

I don't see any unusual spaces offhand on a random diff on mediawiki.org, which I think'll be using the wikidiff2 plugin. Can you provide a URL to a diff page which exhibits this problem and confirm which mode it's using?
Comment 2 db [inactive,noenotif] 2011-05-15 17:07:29 UTC
Maybe bug 25725? Need only recompile on wmf wikis (bug 27720).
Comment 3 Thana 2011-05-15 18:46:34 UTC
example diff url:
http://en.wikipedia.org/w/index.php?oldid=428860852&diff=prev

screen-shot with css rules: font-family:monospace; white-space:pre-wrap;
applied, causing affected cells to occupy three lines (not good).
http://i52.tinypic.com/2lx7z87.png

offending html highlighted here:
http://i51.tinypic.com/2yw9sgn.png

note the gray cells (td.diff-context) do not exhibit the same problem.
Comment 4 Brion Vibber 2011-05-16 12:16:34 UTC
Looks like that's it yeah -- I've added a dep on bug 27720, needs to coordinate w/ ops to make sure the package is updated.

Might also need something to expire cached diffs? I'm not sure if those are perma-cached or just 24h right now.
Comment 5 db [inactive,noenotif] 2012-11-11 11:47:36 UTC
Please test, depending bug 27720 is fixed.
Comment 6 Max Semenik 2014-02-15 21:43:07 UTC
Looks fixed.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links