r92153 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92152‎ | r92153 | r92154 >
Date:11:42, 14 July 2011
Author:diebuche
Status:ok (Comments)
Tags:
Comment:
r92054 : Remove leftover space
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Skin.php
@@ -538,7 +538,7 @@
539539 $colon = wfMsgExt( 'colon-separator', 'escapenoentities' );
540540
541541 if ( !empty( $allCats['normal'] ) ) {
542 - $t = $embed . implode( "{$pop} {$embed}" , $allCats['normal'] ) . $pop;
 542+ $t = $embed . implode( "{$pop}{$embed}" , $allCats['normal'] ) . $pop;
543543
544544 $msg = wfMsgExt( 'pagecategories', array( 'parsemag', 'escapenoentities' ), count( $allCats['normal'] ) );
545545 $s .= '<div id="mw-normal-catlinks">' .
@@ -558,7 +558,7 @@
559559
560560 $s .= "<div id=\"mw-hidden-catlinks\" class=\"$class\">" .
561561 wfMsgExt( 'hidden-categories', array( 'parsemag', 'escapenoentities' ), count( $allCats['hidden'] ) ) .
562 - $colon . '<ul>' . $embed . implode( "{$pop} {$embed}" , $allCats['hidden'] ) . $pop . '</ul>' .
 562+ $colon . '<ul>' . $embed . implode( "{$pop}{$embed}" , $allCats['hidden'] ) . $pop . '</ul>' .
563563 '</div>';
564564 }
565565

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92054Render category links as an HTML list. Bug 12261. Based on patch by Thana & B...diebuche10:41, 13 July 2011

Comments

#Comment by Fomafix (talk | contribs)   09:26, 15 July 2011

Now a line break for word wrapping between the categories is not possible any more. The line can only wrapped in spaces in the category text.

A possible solution would be

#catlinks li { display: inline-block; }

But then a line break in the spaces in the category text is not possible anymore. The separating border would be always in the beginning of the next line.

An other solution would be to insert U+200B Zero-Width Space. When the Zero-With Space is inserted between </li> and <li> the separator border would be at the beginning of the next line. When the Zero-With Space is inserted after <li> the separator border would be at the end of the last line.

The Zero-With Space can also be inserted by CSS:

#catlinks li:before { content: "\200b"; }

The separator border would be at the end of the last line.

#Comment by DieBuche (talk | contribs)   09:45, 15 July 2011

Which browser? Works for me in Chrome, Firefox and Opera

#Comment by Fomafix (talk | contribs)   11:00, 15 July 2011

The following actual category list wraps only between "Lorem" and "ipsum", but not between "ipsum" and "Lorem" on Firefox 3.6.x:

Categories:
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum

Solution 1 #catlinks li { display: inline-block; }:

Categories:
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum

Solution 2 Zero-Width Space before <li>:

Categories:
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum
  • Lorem ipsum

Solution 3 Zero-Width Space after <li>:

Categories:
  • ​Lorem ipsum
  • ​Lorem ipsum
  • ​Lorem ipsum
  • ​Lorem ipsum
  • Lorem ipsum
  • ​​Lorem ipsum
  • ​Lorem ipsum
  • ​Lorem ipsum

#catlinks li:before { content: "\200b"; } is equivalent to solution 3.

Status & tagging log