Page MenuHomePhabricator

Tidy should not create (additional) white space between elements
Closed, ResolvedPublic

Description

Screenshot of Tidy bug

Steps to reproduce:

  • Install MediaWiki 1.20alpha + SyntaxHighlight_GeSHi extension
  • Make sure $wgUseTidy is not set to true in LocalSettings.php (just in case)
  • Create a page with <syntaxhighlight source="php">foo();</syntaxhighlight>
  • View source of the saved page:

<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="javascript source-javascript"><pre class="de1">foo [..]

The page looks fine.

  • Now enable $wgUseTidy (requires that your server has tidy installed)
  • View source of the saved page:
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr">
<div class="javascript source-javascript">
<pre class="de1">
foo<span class="br0">( [..]

This is problematic since elements that preserve whitespace (which can be any element, there is no way to tell from the source code - this is determined by css) will now show up to 3 more new lines before the word "foo".

I've been looking around in the Tidy configuration, but can't find a way to disable this.

Attached:

Screen_Shot_2012-07-29_at_1.38.44_PM.png (490×586 px, 31 KB)

Details

Reference
bz38800

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:09 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz38800.
bzimport added a subscriber: Unknown Object (MLST).

@Marcin: That is in no way related and will not change the number of actual lines outputted by the Tidy parser. This is a bug in Tidy (or a configuration issue), not in Geshi or MediaWiki core.

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

Can you revert I7eec3ffe and use some non-production wiki for your testing?

I see every computer-related article on Wikipedia is broken. How about I just revert it myself?

Reverted in I1ebe3797 and I1977f093 and deployed. Article display seems to be fixed now.

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

This is still an issue, but not longer a blocker to T2260 since we changed Tidy not to generate HTML like this (T85794).

Izno subscribed.

I would guess this is fixed due to Remex if not also matmarex's comment above, though this one I am not confident enough to close myself.

If someone could confirm it's no longer an issue, that would be swell.

ssastry claimed this task.
ssastry subscribed.

Not relevant in RemexHtml land since it doesn't add/delete whitespace not present in the source.

This is still an issue, but not longer a blocker to T2260 since we changed Tidy not to generate HTML like this (T85794).

I would guess this is fixed due to Remex if not also matmarex's comment above, though this one I am not confident enough to close myself.

My comment makes no sense… I think I meant to write "since we changed SyntaxHighlight" :)