Page MenuHomePhabricator

Parsoid: Making a paragraph with forced line breaks in it a heading should strip the line breaks
Closed, DuplicatePublic

Description

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.


Version: unspecified
Severity: normal

Details

Reference
bz52484

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:48 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz52484.

(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.

We shoud try to stop the user from putting line breaks in MWHeadings, but also Parsoid should probably never create invalid wikitext.

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.

Arlolra set Security to None.