long words should be broken in image gallery descriptions
Closed, ResolvedPublic

Description

Single words that are longer than the width of the image thumbnail in image
galleries should be automatically hyphenated and split onto more than one line.
At present the word displays ontop of the caption of the image(s) to the right.
For an example see
http://commons.wikimedia.org/wiki/Train_station#Station_buildings_United_Kingdom
where the word Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch means
you cannot see the first line of the caption for the image to the right (in this
case "Llangollen station, north"


Version: unspecified
Severity: enhancement

bzimport added a project: MediaWiki-Parser.Via ConduitNov 21 2014, 8:53 PM
bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz3770.
Thryduulf created this task.Via LegacyOct 21 2005, 4:18 PM
hashar added a comment.Via ConduitApr 26 2007, 7:36 PM

From
http://petesbloggerama.blogspot.com/2007/02/firefox-ie-word-wrap-word-break-tables.html
it looks like the following css can do the job:

white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */

With css3 we could probably use something like:

word-break: normal;

bzimport added a comment.Via ConduitApr 26 2007, 8:30 PM

ayg wrote:

Those attributes control breaking between words, not within them. They do not
cover hyphenation, which to my knowledge is supported by no major browser today
without hint characters like ­ (and that not by Firefox at least, last I
heard, probably not IE either). We would have to guess at a pixel width for
letters and manually add hyphens and line breaks on the server side where
appropriate. Rather a large ordeal, but I'm sure there's a FLOSS hyphenation
program somewhere that could be integrated into MW if someone wants to do it.

bzimport added a comment.Via ConduitApr 26 2007, 8:32 PM

ayg wrote:

(In reply to comment #2)

Those attributes control breaking between words, not within them. They do not
cover hyphenation, which to my knowledge is supported by no major browser today
without hint characters like ­ (and that not by Firefox at least, last I
heard, probably not IE either). We would have to guess at a pixel width for
letters and manually add hyphens and line breaks on the server side where
appropriate. Rather a large ordeal, but I'm sure there's a FLOSS hyphenation
program somewhere that could be integrated into MW if someone wants to do it.

But note that this would break copy-pasting. The hyphen would be copied. I
would be inclined, actually, to say that this should either be done
transparently by the browser (preserving copy-paste, search, ...) or manually by
editors where strictly needed. We just aren't in a position to do this
intelligently. WONTFIX?

hashar added a comment.Via ConduitApr 26 2007, 8:35 PM

made a confusion between word-wrap and hyphenate. There is nothing on
going at the moment :

http://www.w3.org/TR/css3-text/#hyphenate
brion added a comment.Via ConduitMay 18 2007, 3:53 PM

Something involving 'word-wrap: break-word' may improve the behavior on IE and Safari; currently it's still a little weird for table behavior. Something similar to the recent diff changes might be required, or otherwise different layout for the gallery as with other requests...

DieBuche added a comment.Via ConduitNov 8 2010, 10:44 PM

Marking as depending on Bug 3276 , since word-wrap: break-word doesn't always work in <td> and 3267 get's rid of the tables

DieBuche added a comment.Via ConduitNov 29 2010, 12:29 AM

fixed with r77411

Add Comment