Page MenuHomePhabricator

Inconsistency in handling line-breaks in Remarkup
Closed, DuplicatePublic

Description

My team recently adopted Phabricator, and it is a fantastic piece of work that has become indispensable to our workflow. We are currently using the phacility hosted instances.

We do have a complaint regarding how ReMarkup handles linebreaks. I previously posted this as a follow-up on T51903, but now I think this deserve to be a bug/task report on its own.

Text based markup format such as markdown, rst, and even tex often treat a single linebreak as basically a space, and only honor two or more consecutive linebreaks as a true paragraph break. This behavior supports the following two separate cases very well:

  • People working under a traditional editor such as emacs and vim often manually wrap (or reflow) their paragraphs while editing a differential message or a commit message.
  • People working with an editor that autowraps their lines without inserting linebreak characters, such as the HTML textarea in Phabricator web interface, tend to insert two consecutive linebreaks anyway to separate paragraphs, like what I am doing now in this report.

However, the current behavior of Remarkup is inconsistent in how it treats linebreaks in simple paragraphs and lists. Text paragraphs have their single linebreaks preserved, but lists actually concatenate line breaks.

I suggest adopting the convention of markdown, rst, etc to treat a single linebreak as a space, and only honor two or more consecutive linebreaks as a true paragraph break.

Reproduction steps:

Regular paragraphs

Manually line-wraped long text long text long 
text long text long text text long text long 
text long text long text text long text longtext

A new paragraph, separated by two linebreaks
Manually line-wraped long text long text long 
text long text long text text long text long 
text long text long text text long text longtext

gets turned into

Manually line-wraped long text long text long
text long text long text text long text long
text long text long text text long text longtext

A new paragraph, separated by two linebreaks
Manually line-wraped long text long text long
text long text long text text long text long
text long text long text text long text longtext


But a list with line breaks has the breaks joined

- Manually line-wraped long text long text long 
  text long text long text text long text long 
  text long text long text text long text longtext

  A new paragraph, separated by two linebreaks 
  Manually line-wraped long text long text long 
  text long text long text text long text long 
  text long text long text text long text longtext

- A new item
  • Manually line-wraped long text long text long text long text long text text long text long text long text long text text long text longtext

    A new paragraph, separated by two linebreaks Manually line-wraped long text long text long text long text long text text long text long text long text long text text long text longtext
  • A new item