It is possible (if inadvisable) to have whitespace at the start of a paragraph in HTML; to readers it is mostly invisible. In MediaWiki, because whitespace at the start of a paragraph has magic meaning, Parsoid <nowiki />s it. To avoid users doing this accidentally, it might be nice to design a way to flag to the user what they've done when they create these.
- Mentioned In
- T53758: Visual editor: issues with removing leading space pre blocks
T94767: Perform a weekly review of edits made with VisualEditor
T90533: Space at the start of a line is being nowikid
- Mentioned Here
- T94767: Perform a weekly review of edits made with VisualEditor
T78137: Leading white spaces should be highlighted and converted to or something
T93935: When splitting a paragraph, trim whitespace from the start of the new one
T55548: VisualEditor: nowiki tags thrown right after a template
No, they actually are not shown.
Download the screenshot and pull it into Preview on your Mac. Zoom in six times, scroll way over to the red ovals, and use "Tools:Annotate:Line" to draw a vertical line down the leading edge of those paragraphs. Hold down your shift key to keep the line straight. Set the line to the thinnest option in the toolbar.
Now count the pixels between your line and the beginnings of each letter on those paragraphs. The straight edge on the 'r' of 'raised', the 'E' of 'Experience', and the 'M' of 'Modern' are very convenient for this.
There is no visible difference. Where I drew my line, I found exactly one pixel between my line and the start of each character. Something that does not display as even a single pixel on a reasonably typical laptop is properly described as "not shown".
This is still happening. I'm still not doing anything exceptional: I put my cursor in between two sentences and press the Return key. This still should not be happening. If I want to start a paragraph with a space, then I should have to actually press the space bar.
The nowikied space also persists if a user then removes the newline. See https://en.wikipedia.org/w/index.php?diff=653301980 for an example in which:
- an existing nowikied space at the beginning of a paragraph now lives in the middle of a paragraph;
- a new nowikied space was added at the beginning of a paragraph.
Are there any valid use cases for keeping those white spaces at the beginning of a paragraph? Otherwise I think we should just remove them. If we don't want to remove them automatically on save, then as @Whatamidoing-WMF suggested in T68628#967908 , we should at least remove the space when editing, so that the nowikied space is added only if the user explicitly inserts it.
I have reverted the title change because it is completely wrong. "Remove nowikied spaces at the beginning of a paragraph unless the user manually inserted them" means "please corrupt pages on load", and is absolutely the wrong this to do. VisualEditor is not in the business of "fixing" pages. If you click edit, then click save without making changes, there should never ever be any difference, or we've failed.
This appears to be fixed now (same browser/same article test).
I think that a title of "Stop adding nowiki'd spaces at the start of newly
split paragraphs" would capture the ask better. I don't really want to see
the spaces (although that would be better than having them present but
invisible); I want the stray spaces to not be present in the first place.
I've restored this task back to what it's about, which is a design issue about discouraging odd user behaviour, and has essentially nothing to do with <nowiki />s, which are already dealt with in multiple other tasks.
I'm having second thoughts about my earlier all-clear. It's possible that this problem only arises if the wikitext uses French spacing (two spaces after the full stop). If that's the case—if it strips one space but leaves the second—then my test yesterday is inadequate, because I didn't check what the wikitext looks like.
T78137: Leading white spaces should be highlighted and converted to or something sounds like an interesting approach.
I tested now and it seems like the leading spaces can still be created and displayed in the editor, but magically disappear when the MediaWiki page is saved.
This issue came up 4 times out of 100 reviewed diffs, and accounted for ⅔ of problematic diffs on the English Wikipedia this week ( T94767#1225878 ). I see this being a possible point of contention during a wider roll-out.
Based on those numbers, I'm re-nominating this issue as a blocker for further discussion.
It's still happening: https://en.wikipedia.org/w/index.php?diff=660662487&oldid=657477479 The original had only one space between paragraphs, but I usually add two in wikitext ("English spacing"), so there may have been two spaces at the time that I hit return to split the paragraphs.