Page MenuHomePhabricator

VisualEditor: ↵ is shown when wikicode contains single newline, which is not very WYSIWYG
Open, MediumPublic

Description

Single newlines have no effect on the way a wiki page is displayed.
So they should be ignored in a WYSIWYG editor.

Example: Third line at http://en.wikipedia.org/wiki/Content_Management_Interoperability_Services#Specification_progress_.26_TC_members

Details

Reference
bz48290

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:23 AM
bzimport set Reference to bz48290.

(In reply to comment #0)

Single newlines have no effect on the way a wiki page is displayed.
So they should be ignored in a WYSIWYG editor.

Example: Third line at
http://en.wikipedia.org/wiki/
Content_Management_Interoperability_Services#Specification_progress_.
26_TC_members

Yeah, this is a bit of a mess. In wikitext (except in some circumstances like <pre>s), \n is a whitespace character, rendered as either a space or as nothing depending on the things around it, but \n\n is "</p><p>".

We could:

  • Silently strip non-conformant wikitext syntax like this on ingest, but this would mean that VisualEditor would not play well with other, wikitext-based users.
  • Show the newline as a line break in VisualEditor - in a way that (a) doesn't look like a new paragraph/context has started, and (b) doesn't look like <br />s will look, either, and in some way conveys the fact that it's different.
  • (Current behaviour) Show the newline as a special kind of character in VisualEditor - in a way that (a) doesn't look like a 'real' new line, because it isn't.
  • Silently not show the new line as such (but instead as… a space?), which is prone to having users accidentally alter them without intention, again causing problems for intermixed VisualEditor and wikitext editor sessions.

What are your thoughts?

Same for TAB characters, which are shown as ➞

TAB characters have no meaning in wikicode, and I can't imagine anyone entering them for any purpose (plus they are difficult to enter in an HTML form).
I have never seen a case where they are intended (please point me to any example if I am mistaken).

I personally think TABs are a case where silent stripping would be acceptable.


Newline characters are more debatable, because some people use them to make wikicode more readable.

(In reply to comment #2)

Newline characters are more debatable, because some people use them to make
wikicode more readable.

...and I remmember some people use them to make diffs more readable[citation needed].

  • Bug 61569 has been marked as a duplicate of this bug. ***
  • Bug 50641 has been marked as a duplicate of this bug. ***

Indeed not WYSIWYG, but I happen to love this feature. I practically always remove these links when I see them. I'd say WONTFIX.

  • Bug 65324 has been marked as a duplicate of this bug. ***
  • Bug 68811 has been marked as a duplicate of this bug. ***
  • Bug 57454 has been marked as a duplicate of this bug. ***

I like the idea of showing it as a line break. This might make more sense to less-technical people that have just copy-pasted text out of another document (one of the apparent causes) than the insertion of an unexpected symbol.

I like the idea of showing it as a line break. This might make more sense to less-technical people that have just copy-pasted text out of another document (one of the apparent causes) than the insertion of an unexpected symbol.

I'm not a fan of making VE less like the reading experience, though.

Unless I'm misunderstanding Whatamidoing, I think they mean that we copy
line breaks in as actual linebreaks, so that reading and editing look the
same and no one actually sees that carriage return symbol ever.

*Jared Zimmerman * \\ Director of User Experience \\ Wikimedia Foundation

M +1 415 609 4043 \\ @Jaredzimmerman http://loo.ms/g0

Unless I'm misunderstanding Whatamidoing, I think they mean that we copy
line breaks in as actual linebreaks, so that reading and editing look the
same and no one actually sees that carriage return symbol ever.

Yes, you're entirely missing the point here.

  • Actual reader-visible new paragraphs (from two new lines after each other in wikitext) are shown as new paragraphs.
  • Actual reader-visible line breaks (from a <br /> tag) are shown as line breaks.

This is about how to represent the reader-invisible nonsense wikitext single new line. See T50290#499295 for details; nothing's changed here since May 2013.

@Jdforrester-WMF let me try to rephrase to see if I understand, the
carriage return symbol is shown in VE because a wikitext editor has
included a line break in the editing environment to increase readability of
the wikitext, however this does not affect the presentation of the content
in read mode, and is meaningless and confusing to VE editors.

However there is a worry (by whom?) that not showing the character at all
would make it much easier for a VE editor to accidentally remove the
character because it has no visual representation. On the other hand
visualizing it as an actual line-break causes inconsistency between edit
and read modes (which currently exists in wikitext/read more)

Is that summary clear and factual?

*Jared Zimmerman * \\ Director of User Experience \\ Wikimedia Foundation

M +1 415 609 4043 \\ @Jaredzimmerman http://loo.ms/g0

Additional feedback from a German editor regarding this issue:
"Wikipedians delete the '↵' in VisualEditor and replace it with a space. But this character '↵' only indicates that a break was added to the source for better readability, which is automatically translated into a space. It's often used in long citation blocks, for example. This' ↵'-character makes the Wikitext / source text more readable. The good readability of the source text in the source editor (Edit window) is still one of the quality indicators explicitly mentioned in our guidelines for good articles. The meaning in the VisualEditor is only that the user should insert a new text not to the left but to the right of the '↵' character. Just simply so that the line break in the source text remains directly behind the left character. But, when looking at the instructions, this subtlety is not mentioned. Also, no warning is displayed when you delete the '↵' character in the VisualEditer. Apparently the character can not be inserted in the VirtualEditor any more, if it was deleted. [...] I would hope that there is a warning when deleting the character or a tooltip when the mouse is hovering above the character. Thank you."

That sounds very project-specific. In my experience, line breaks (shown as '↵' in VisualEditor) on enwiki often mean that someone has copied and pasted the text from another document (e.g., written the text offline in a word processor). It only rarely seems to be done intentionally.

(Also, what if a line break someday stopped being interpreted as a space?)

On enwiki, one of the common uses of this is when people have a big {{Cite}} template and hit enter after it for readability.

One thing having this character visible does is encourage experienced editors to delete it.

When I was a newer editor, I had no idea what this character meant and it took me awhile to figure it out.

Anyway, I think leaving it as is (current behavior) or removing it from being seen in the visual editor without changing any wikitext would be acceptable options. I don't think "silently strip" is a good option.