Page MenuHomePhabricator

VisualEditor: Unexpected behavior when line starts with space
Closed, DeclinedPublic

Description

nowiki tags

edit a line in VE such that it starts with a space

VE unexpectedly inserts <nowiki> tags on the text of the line

edit a line in VE such that it starts with a text, and add bold or italic to the middle of the line somewhere

VE inserts <nowiki> tags up to the formatted character and leaves the rest of the line alone


Version: unspecified
Severity: normal

Attached:

Screen_shot_2013-01-29_at_12.20.57_PM.png (190×985 px, 19 KB)

Details

Reference
bz44478

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:21 AM
bzimport set Reference to bz44478.

Created attachment 11706
nowiki tags with formatted text

Attached:

Screen_shot_2013-01-29_at_12.21.55_PM.png (194×943 px, 20 KB)

I'm not entirely convinced what the expected behaviour is - should it be just the leading ' ' character that is wrapped in <nowiki> elements?

look what happens in the regular editor. I think VE is doing something really strange here.

No, this is expected behaviour. A line that starts with " " in wikitext is a pre-formatted block. If VE just let users save <P> Foo</P> as " Foo" they'd get very unexpected results.

We don't (and won't) expect users to understand that certain characters are magic and can't be used in certain places, and instead we need to escape character sequences they've entered that happen to be 'magic'.

Unless I'm missing something?

Maybe I'm missing something.

I've attached a screen shot comparing preview in the normal editor to preview in VE where both are doing exactly the same operation: editing the string " leading space" where the "adi" part of the string is made both bold and italic.

The normal editor does not add <nowiki> tags to this string. VE adds <nowiki> tags.

The normal editor does not save the text with <nowiki> tags. VE saves the text with <nowiki> tags.

It may be that VE adds <nowiki> tags by design, but they seem unnecessary. Again, I could be wrong.

Created attachment 11718
normal editor vs. VE preview

Attached:

Screen_shot_2013-02-01_at_11.27.13_AM.png (353×1 px, 110 KB)

Created attachment 11719
normal editor vs. VE on save

Attached:

Screen_shot_2013-02-01_at_11.37.05_AM.png (256×963 px, 86 KB)

... but when you save " le'''''adi'''''ing space" in the wikitext editor, you get <pre>le'''''adi'''''ing space</pre>, not <p> le'''''adi'''''ing space</p>. The <nowiki> tags are necessary to get the latter, which is what the VE user actually typed.

Closing as WONTFIX.