Page MenuHomePhabricator

Allow line breaks in list items
Closed, WontfixPublic

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

Event Timeline

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

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

This comment was removed by dtf.

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

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.
epriestley claimed this task.
epriestley added a subscriber: epriestley.

I don't currently plan to support this. You may be able to add a rule to support something like <br /> with a Remarkup extension.