Allow line breaks in list items
Open, Needs TriagePublic

Description

Like T5427: Force a line break in a table cell, but for list items. This could significantly improve readability.

Foo:
* First line.
 Second line.
* Other.

Foo:

  • First line. Second line.
  • Other.

(Renders as one line.)

Bar:
* First line.

 Second line.
* Other.

Bar:

  • First line.

    Second line.
  • Other.

(Renders as separate lines, though with two lines breaks instead of one.)

Quux:
*
 First line.
 Second line.
* Other.

Quux:

  • First line. Second line.
  • Other.

(Renders as one line.)

Note: This is currently supported by GFM, by allowing <br/>.

Krinkle created this task.Jul 6 2016, 9:33 PM
Krinkle updated the task description. (Show Details)Jul 6 2016, 9:42 PM
chad added a subscriber: chad.Jul 6 2016, 10:12 PM

Can you give an example of what specifically you are trying to build in Phabricator?

chad added a comment.Jul 7 2016, 12:04 AM

Cursory research yields Markdown uses two spaces to indicate a <br />.

dtf added a subscriber: dtf.Jul 7 2016, 9:01 AM
This comment was removed by dtf.
dtf added a comment.EditedJul 7 2016, 9:03 AM

Maybe something like long lists with "titles" or "summaries" for list elements?

# Something top-level
  Long, multi-sentence description of this top-level list item.
 - Sub-element with "title" <br/>
   Long, multi-sentence description of this inner list item.
 - **Another sub-element, highlighted even** <br/>
   Another long description.
   Very long and very descriptive. 
# Something else

which renders like:

1. Something top-level
   Long, multi-sentence description of this top-level list item.
 
  • Sub-element with "title"
    Long, multi-sentence description of this inner list item.

  • Another sub-element, highlighted even
    Another long description. Very long and very descriptive. 

2. Something else
Krinkle added a comment.EditedJul 11 2016, 11:35 PM
In T11284#184462, @chad wrote:

Can you give an example of what specifically you are trying to build in Phabricator?

Example at https://phabricator.wikimedia.org/T139300#2435219. I would've much preferred to put one line break between the first line and any further sentence(s) within a list. Exactly as @dtf illustrates above.

This comment was removed by chad.
chad moved this task from Backlog to Parser on the Remarkup board.Mar 27 2017, 3:52 PM

Thanks to chad for marking my related T12490 as a duplicate.

Just to add a different perspective, I would like to argue for treating a single line-break as a space, and multiple consecutive line-breaks as true paragraph break, both in regular texts and lists.

This is the convention of a lot of existing plain text based markup format such as markdown, rst, and even tex/latex. The main benefit is that this convention supports the following two flavors of text editing at the same time:

  • People using traditional editor such as emacs and vim often manually wrap (or reflow) their paragraphs while editing a differential message or a commit message. In such cases, two consecutive linebreaks are understood to mean a true paragraph break.
  • People using an editor that autowraps lines while displaying, without inserting actual linebreak characters, such as the HTML textarea in the Phabricator web interface, tend to insert two consecutive linebreaks anyway to separate paragraphs, like what I am doing now in this comment.