Page MenuHomePhabricator

VisualEditor: Long lines in preformatted paragraphs should not wrap in VE
Closed, ResolvedPublic1 Estimated Story Points


When a pre-formatted paragraph with long lines is displayed in VE it word wraps. However it doesn't word-wrap in display mode (T2260), meaning that you have no idea that you need to add manual line breaks until after you have saved.

See (rendered) and (in VE)

The word wrapping in VE is actually better than what happens in read mode, but the two should not be different. Fixing T2260 would be better, but as it's been open since 2004 adjusting VE to match the current behaviour seems more realistic :/

Version: unspecified
Severity: minor
See Also:


Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:05 AM
bzimport set Reference to bz54381.

Alternatively we could fix this bug in MediaWiki…

Created attachment 17129
Preformatted text in Edit- word wrapping is present


Created attachment 17130
Read - no word wrapping


This comment was removed by matmarex.

We have { white-space: pre-wrap; } added per T40043, because Chrome/Safari will otherwise also wrap the text, not just between words, but anywhere (this affects any <pre> inside a contenteditable="true" node). I did some searching and found; it appears that we can set word-wrap: normal; to override this behavior.

We also need to remove overflow: hidden from the surface to get regular sane horizontal scrolling behavior. It doesn't seem to be necessary…

Change 205177 had a related patch set uploaded (by Bartosz Dziewoński):
Do not wrap <pre> nodes

Esanders set Security to None.

Change 205177 merged by jenkins-bot:
Do not wrap <pre> nodes