Last modified: 2014-01-30 17:45:07 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 T54484, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52484 - Parsoid: Making a paragraph with forced line breaks in it a heading should strip the line breaks
Parsoid: Making a paragraph with forced line breaks in it a heading should st...
Status: ASSIGNED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Gabriel Wicke
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-02 23:29 UTC by Chris McMahon
Modified: 2014-01-30 17:45 UTC (History)
9 users (show)

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


Attachments

Description Chris McMahon 2013-08-02 23:29:55 UTC
For  comparison, in the wikitext editor open any page and click Heading/Level2.  The editor creates a new example heading at the top of the page. 

VE has a number of confusing cases: 

In each case, open the page, edit in VE, and click Heading:

* If the page starts with non-editable line like an image link, clicking Heading does nothing at all and the Save page button does not become enabled

* If the page starts with a single line of text, VE turns that text into a heading

* If the page starts with lines containing single line breaks, VE wraps the whole string in "==" thus garbling the contents of the page.  For example if a page begins with

A line
another line

VE turns that into

==A line
another line==

and then forces the user to go through the "Wiki markup detected" dance. Note that if the user actually does select "A line/another line" then the behavior of VE is subtly different, which is also confusing.  

Suggest that clicking Heading without any text selected should create an example heading as the old wikitext editor does.
Comment 1 James Forrester 2014-01-22 19:24:03 UTC
(In reply to comment #0)
> VE has a number of confusing cases: 
> 
> In each case, open the page, edit in VE, and click Heading:
> 
> * If the page starts with non-editable line like an image link, clicking
> Heading does nothing at all and the Save page button does not become enabled
> 
> * If the page starts with a single line of text, VE turns that text into a
> heading

That's where the cursor is, yes. I don't think that either of these are a bug per se, but yes, they're a bit confusing.

> * If the page starts with lines containing single line breaks, VE wraps the
> whole string in "==" thus garbling the contents of the page.  For example if
> a
> page begins with
> 
> A line
> another line
> 
> VE turns that into
> 
> ==A line
> another line==
> 
> and then forces the user to go through the "Wiki markup detected" dance. Note
> that if the user actually does select "A line/another line" then the behavior
> of VE is subtly different, which is also confusing.  
> 
> Suggest that clicking Heading without any text selected should create an
> example heading as the old wikitext editor does.

Yeah, confirmed. Re-titling the bug to specify.

Sorry for very slow triage.
Comment 2 Ed Sanders 2014-01-30 16:39:46 UTC
We shoud try to stop the user from putting line breaks in MWHeadings, but also Parsoid should probably never create invalid wikitext.
Comment 3 Ed Sanders 2014-01-30 17:45:07 UTC
Assigning to Parsoid as it would be impossible to prevent the user from adding a line break character to certain elements in the DM. Conversion, mentioned above, would be fixable, but there's copy and paste, paragraph merging and probably others etc.

The only sensible approach is to convert these to spaces at Parsoid's end.

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


Navigation
Links