See the user-created screenshot: http://img24.cz/images/77346777291945590436.jpg
Steps to reproduce:
- Open any page containing a gallery in VisualEditor, or go to Insert > More > Gallery and add one.
- See the mess.
• Whatamidoing-WMF | |
Dec 15 2015, 6:55 PM |
F3125834: Screen Shot 2015-12-19 at 22.35.01.png | |
Dec 19 2015, 9:40 PM |
F3125832: Screen Shot 2015-12-19 at 22.34.51.png | |
Dec 19 2015, 9:40 PM |
F3106100: 77346777291945590436.jpg | |
Dec 15 2015, 9:44 PM |
See the user-created screenshot: http://img24.cz/images/77346777291945590436.jpg
Steps to reproduce:
Interesting. The solution is just:
ul.gallery { white-space: normal; }
But I'm not sure if we should add that in core, or in VE VE-MW.
The real problem that we are applying a CSS change to the whole document that doesn't exist in read mode. We could end up playing whack-a-mole with endless extensions that exhibit the same problem.
A better solution is to target our original hack more specifically - or remove it all together.
I do think that white-space: pre-wrap is a much better solution to the problem of displaying several spaces in a row that peppering the document with that are stripped on save. Perhaps we could get away with only applying the style to p or something (I'm sure there are edge cases of other nodes containing text content to consider). Or perhaps we should make the result of <gallery> tags not contain newlines between <li></li> tags (which is why newlines appear with pre-wrap).
The CSS may be a neater solution but unless we can apply it to just the bits we want its a non-starter.
Change 259488 had a related patch set uploaded (by Esanders):
Move white-space: pre-wrap hack to ContentBranchNode
Change 259488 merged by jenkins-bot:
Move white-space:pre-wrap hack to ContentBranchNode
Another effect of this CSS on https://en.wikipedia.org/wiki/Hockenheim?veaction=edit
As can be seen in the attached screenshots, the image map is chased outside of the infobox for some reason.
Not sure what it does icw the new patch.
And another case with hlist's in this particular case inside navboxes: https://en.wikipedia.org/wiki/Liparoo,_Victoria?veaction=edit
Both these examples will be fixed by the latest patch as they aren't in paragraphs but, @matmarex, this convinces me that the CSS solution is unsustainable. I can guarantee there are inline templates and extensions out there that are getting broken by this fix. We just haven't found them yet.
It's basically impossible to interfere with generic content styles without breaking things.
Change 260432 had a related patch set uploaded (by Alex Monk):
Move white-space:pre-wrap hack to ContentBranchNode
Ehh… but we control the HTML on the editing surface. Can't we just .replace( /\n/g, ' ' ) in GeneratedContentNode or something to avoid this?
Change 260432 merged by jenkins-bot:
Move white-space:pre-wrap hack to ContentBranchNode