Page MenuHomePhabricator

Non-breaking space broken after <pre>
Closed, ResolvedPublic


Author: omniplex

Non-breaking space in all its forms should be rendered as &#160;
(working with all browsers I'm aware of) or &nbsp; (issues with
one old browser if there are two or more adjacent &nbsp;).

Under absolutely no circumstances can &nbsp; / &#160; / &#x00A0;
or the corresponding UTF-8 be rendered as mere SP, that causes
havoc. This appears to be relatively new (2006-04-13 maybe?).

I've tested it elsewhere with action=render, it's no skin issue.

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:12 PM
bzimport set Reference to bz5569.
bzimport added a subscriber: Unknown Object (MLST).

omniplex wrote:

Whatever it is, it's not everywhere.

omniplex wrote:

I've tracked it down in

Theory: On a page with <pre>...</pre> later occurences of
nbsp or #160 are translate to a space. An empty <pre></pre>
doesn't have this side-effect.

The example was in a discussion about another <pre> oddity
at the bottom of:

Something with <pre> is odd. And that's not new, I always
(this year) avoided it, because it doesn't behave like a
normal XHTML <pre>.

Please provide example input and output, clearly labeled.

Probably a bug in tidy. Can reproduce locally only with tidy enabled.

  • Bug 5717 has been marked as a duplicate of this bug. ***

omniplex wrote:

This hits me about once per day, and there's absolutely no workaround,
therefore I mark it as "serious". It's easy to avoid all &lt;pre&gt;
and Wiki "space in column one" on a new page, but a PITA on old pages
if I want &nbsp; to work as designed.

It breaks my signature. It breaks templates like Tlx and Tlsp. It breaks
dummy &nbsp; table cells.

  • Bug 6339 has been marked as a duplicate of this bug. ***
  • Bug 6430 has been marked as a duplicate of this bug. ***
  • Bug 6725 has been marked as a duplicate of this bug. ***

Created attachment 2122
test case to reproduce the problem with tidy on the command line

I can verify the bug (directly on the command line) with the tidy version "HTML
Tidy for Linux/x86 released on 1st March 2004": After the <pre>-block, all
&nbsp; are replaced by regular space. This is fixed in newer versions of tidy:
the problem is gone in version "HTML Tidy for Linux/x86 released on 1 September


ayg wrote:

This breaks <poem> tags too (see [[s:en:Help:Editing poetry]]).

ayg wrote:

This is because Tidy hasn't been updated, not a MediaWiki problem. MediaWiki ->

erikbaas wrote:

This bug breaks pages and templates on Dutch WP too: [[s:nl:Gebruiker:Erik

ayg wrote:

Should have been fixed by Tim upgrading Tidy.