Page MenuHomePhabricator

Category tags produce ugly whitespace
Closed, ResolvedPublic

Description

Author: timwi

Description:
BUG MIGRATED FROM SOURCEFORGE
http://sourceforge.net/tracker/index.php?func=detail&aid=963423&group_id=34373&atid=411192
Originally submitted by Nobody/Anonymous - nobody 2004-05-31 08:39

[[Category: tags create blank lines if they exist
solely on one line in some cases. Examples:

interwiki links creating blank line at top, category
tag creating blank tag at bottom

http://en.wikipedia.org/wiki/List_of_AL_Gold_Glove_Winners_at_Shortstop

  • cat tags creating blank line at top

Thanks! :)

  • Additional comments ------------------------

Date: 2004-05-31 09:23
Sender: nobody
Logged In: NO

This seems to be a consequence of the Cologne Blue skin not
showing up categories visibly in an article, while Monobook

does.

Date: 2004-07-03 04:14
Sender: nobody
Logged In: NO

Agreed, this is quite bothersome, I hope this will be fixed.
It's especially distracting when the tags are on the top of
the page and create superfluous space between the title and
intro. I've been moving tags to the bottom to reduce the
visibility of this, but this should really be dealt with
automatically.


Version: unspecified
Severity: normal

Details

Reference
bz87

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 21 2014, 6:43 PM
bzimport added projects: MediaWiki-Parser, Parser.
bzimport set Reference to bz87.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Aug 16 2004, 6:00 AM

wikibug.5.starfury wrote:

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

bugzillas+padREMOVETHISdu wrote:

This bug is said to be only in the Cologne Blue skin, so how could it be parser
related?

zigger wrote:

This bug also occurs in monobook. Probably related to bug 833.

brion added a comment.Dec 29 2004, 3:30 AM
  • Bug 1223 has been marked as a duplicate of this bug. ***

I believe this bug got fixed somehow in the 1.4beta serie.
Please have a look at it on your local installation or
on http://en.wikipedia.org/ which is using 1.4beta .

If the issue is still happenning, please submit a screenshot
of it and the mediawiki version (in [[Special:Version]] ).

grendelkhan wrote:

It's not fixed. See [[Albert Einstein]]. Interwiki tags don't make whitespace,
but category tags do. I'll get a screenshot when I'm on a computer that doesn't
suck.

richholton wrote:

Patch to eliminate ugly whitespace for categories

This patch should do the trick. Just borrowed some code from the interwiki link
processing.

attachment parserdiff.txt ignored as obsolete

avarab wrote:

The patch by Richard J. Holton appers to have been applied to HEAD by gabriel
wicke, but the problem persists.

richholton wrote:

(In reply to comment #8)
Changes applied to HEAD are not currently available in any released
product...only in 1.5 development.

Are you testing a 1.5 installation, or looking at the live Wikipedia or a sister
project?

avarab wrote:

Testing it in HEAD of course.

richholton wrote:

Actually, as far as I can tell, the patch has not been applied to HEAD / MAIN.

richholton wrote:

Awww..Crap! My bad. The patch is running the wrong way! The line it's set to add
should be deleted. The two it's set to delete should be added.

richholton wrote:

fixes the bug (patch runs in correct direction, too!)

See the corrected patch.

Attached:

avarab wrote:

I already tried the previous patch with /patch -R/ (reverses the patch) and I
also tried this one too and the problem persists, I'm using a copy of the Albert
Einstein article from en. to test it, the outputted HTML is (not that I added
some more categories):

""""""""""""""""""""""""""""""
[...]
</li><li> <a href="http://www.economist.com/displaystory.cfm?story_id=3518580"
class='external text' title="http://www.economist.com/displaystory.cfm?story
id=3518580" rel="nofollow">Economist article "100 years of Einstein"</a>
</li></ul>
<p><br />

</p><p><br />
</p><p><br />
</p><p><br />
</p><p><br />
</p><p><br />
</p><p><br /> <!----- This is the category whitespace in question ---->
</p><p><br />
</p><p><br />
</p><p><br />
</p><p><br />
</p><p><br />
</p><div class="printfooter">
Retrieved from "<a
href="http://localhost/mw/HEAD/wiki/Albert_Einstein">http://localhost/mw/HEAD/wiki/Albert_Einstein</a>"</div>

	    <div id="catlinks">

""""""""""""""""""""""""""""""

the.r3m0t wrote:

Works perfectly for me. I suggest just opening the file includes/Parser.php and
going to line 1294. Here's what the code should look like (with 5 lines before
and 5 lines after which should help you locate the change)

} else {
        $sortkey = $text;
}
$wgLinkCache->addCategoryLinkObj( $nt,

$sortkey );

                $this->mOutput->addCategoryLink( $t );
                $tmp = $prefix . $trail ;
                $s .= (trim($tmp) == '')? '': $tmp;
                
                wfProfileOut( "$fname-category" );
                continue;
        }
}

It works well for me.

avarab wrote:

I probably made some kind of error when testing it previously, anyway I went
over it again and it seems to work for me™, I've committed it to REL1_4 and
HEAD, sorry for the mistake and thanks for the patch.

river wrote:

Checked in to CVS. Information at:

http://mail.wikimedia.org/pipermail/mediawiki-cvs/2005-April/007528.html

Please be aware that changes won't show up on Wikipedia until the new
code is put live, which can take hours or days, often up to a week.

wmf.amgine3691 wrote:

<historic hug to River> No particular reason, just warm memories.

Change 371735 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Fix link prefix/suffixes around Category and Language links.

https://gerrit.wikimedia.org/r/371735

Change 371735 merged by jenkins-bot:
[mediawiki/core@master] Fix link prefix/suffixes around Category and Language links.

https://gerrit.wikimedia.org/r/371735

Change 376441 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] [WIP] Fix link prefix/suffixes around Category and Language links (take 2).

https://gerrit.wikimedia.org/r/376441

Change 376441 merged by jenkins-bot:
[mediawiki/core@master] Fix link prefix/suffixes around Category and Language links (take 2).

https://gerrit.wikimedia.org/r/376441