Last modified: 2013-02-07 03:33:35 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T46478, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44478 - VisualEditor: Unexpected behavior when line starts with space
VisualEditor: Unexpected behavior when line starts with space
Status: RESOLVED WONTFIX
Product: VisualEditor
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: James Forrester
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-29 19:25 UTC by Chris McMahon
Modified: 2013-02-07 03:33 UTC (History)
2 users (show)

See Also:
Web browser: Google Chrome
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
nowiki tags (19.64 KB, image/png)
2013-01-29 19:25 UTC, Chris McMahon
Details
nowiki tags with formatted text (20.59 KB, image/png)
2013-01-29 19:26 UTC, Chris McMahon
Details
normal editor vs. VE preview (110.29 KB, image/png)
2013-02-01 18:41 UTC, Chris McMahon
Details
normal editor vs. VE on save (86.46 KB, image/png)
2013-02-01 18:42 UTC, Chris McMahon
Details

Description Chris McMahon 2013-01-29 19:25:58 UTC
Created attachment 11705 [details]
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
Comment 1 Chris McMahon 2013-01-29 19:26:43 UTC
Created attachment 11706 [details]
nowiki tags with formatted text
Comment 2 James Forrester 2013-01-31 22:02:19 UTC
I'm not entirely convinced what the expected behaviour is - should it be just the leading ' ' character that is wrapped in <nowiki> elements?
Comment 3 Chris McMahon 2013-01-31 22:24:45 UTC
look what happens in the regular editor.  I think VE is doing something really strange here.
Comment 4 James Forrester 2013-02-01 01:29:49 UTC
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?
Comment 5 Chris McMahon 2013-02-01 18:40:05 UTC
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.
Comment 6 Chris McMahon 2013-02-01 18:41:27 UTC
Created attachment 11718 [details]
normal editor vs. VE preview
Comment 7 Chris McMahon 2013-02-01 18:42:04 UTC
Created attachment 11719 [details]
normal editor vs. VE on save
Comment 8 James Forrester 2013-02-07 03:33:35 UTC
... 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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links