Page MenuHomePhabricator

Parsoid should use <br/> to handle paragraph tags in single-line-mode wikitext constructs like list items
Closed, DuplicatePublic

Description

Version information:
Windows 10 (Fall Creators Update, Version 10.0.16299.64)
Chrome 62.0.3202.94
MediaWiki 1.29.1
VisualEditor 0.1.0 (b655946) 19:55, November 3, 2017

Description:
When editing a list, pressing Shift+Enter causes a hard line break to appear in the editor, for example:

1. My List
    • My Point [Press Shift+Enter Here]
      My Line-break point

However, when saving the page, this is what the Wikitext ends up looking like:

# My List
#* My Point  My Line-break point

(Note that there are *two sapces* where the line break should have been.)

And the resulting rendered page looks (incorrectly) like:

  1. My List
    • My Point My Line-break point

Expected behavior:
Pressing Shift+Enter should insert a <br /> tag, as is recommended on the Line-break handling article on Wikipedia.

Event Timeline

Current pressing shift-enter in a list splits the paragraph:

<ul><li><p>Foo</p><p>bar</p></li></ul>

which converts to
* Foo bar

So we may want to fix this in Parsoid

Yes, this is deliberate and known behavior in Parsoid. For single-line mode constructs (like list items), we force conversion to single-line context. But, we could convert those to add <br/> instead, I suppose.

ssastry renamed this task from Hard line breaks (not paragraphs) render correctly but do not save properly to Parsoid should use <br/> to handle paragraph tags in single-line-mode wikitext constructs like list items.Nov 20 2017, 4:17 PM
ssastry triaged this task as Medium priority.
ssastry removed a project: VisualEditor.

Right now, Parsoid does this for <li>, <dd>, <dt>, and <h*> tags. We could use the <br/> solution for li, dd, dt tags. What about h* tags? Should we retain current behavior? Or is <br/> the expectation there?