Project

General

Profile

Actions

Defect #21181

closed

Markdown Formatter incorrectly parses lists

Added by Anonymous over 8 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Text formatting
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Originally I wanted to raise a bug about the markdown formatter wrongly interpreting a list sub item as code, because it ignored the double identation instead of single identation for code in lists.

But while building a proper example to reproduce the behavior easily I found that the whole list parsing (for both ordered and unordered lists) is borked.

While I would like to be able to provide exact directions to what exactly is wrong here, the more I played around with this, the more confused I got.

What I can tell for almost certain is that blank lines are at the core of this issue. Normally items should be wrapped in <p> tags when seperated by blank lines, but here (at least for unordered list items in ordered list items) instead the current ordered list is interpreted as ended and a new ordered list started.

I used the official syntax from https://daringfireball.net/projects/markdown/syntax#list as reference, which describes behavior conflicting with what Redmine produces currently.

Example Markup

1.  this is a list item with two child items.
    -  first child

    -  second child wrongly interpreted as code
1.   another item in the same list.
-  text wrongly interpreted as ordered list item

1. last item of the ordered list

Expected Output (taken form Marxico)

Expected Output (taken form Marxico)

Output from Redmine's inbuilt Markup Parser

Output from Redmines inbuilt Markup Parser


Files

correct.JPG (20.3 KB) correct.JPG Expected Output (taken form Marxico) Anonymous, 2015-11-08 21:36
wrong.JPG (25 KB) wrong.JPG Output from Redmines inbuilt Markup Parser Anonymous, 2015-11-08 21:36
expected_m.png (187 KB) expected_m.png Marius BĂLTEANU, 2018-03-31 11:41
parse_lists.png (49.1 KB) parse_lists.png Marius BĂLTEANU, 2022-01-22 10:56

Related issues

Related to Redmine - Feature #32424: CommonMark Markdown Text FormattingClosedMarius BĂLTEANU

Actions
Actions #1

Updated by Martin von Wittich about 6 years ago

Still reproducible on 3.4.2.

Actions #2

Updated by Marius BĂLTEANU almost 6 years ago

  • File output.png added
  • File expected_m.png added
Actions #3

Updated by Marius BĂLTEANU almost 6 years ago

  • Status changed from New to Needs feedback
Actions #4

Updated by Marius BĂLTEANU almost 6 years ago

  • File deleted (output.png)
Actions #5

Updated by Marius BĂLTEANU almost 6 years ago

  • File deleted (expected_m.png)
Actions #6

Updated by Marius BĂLTEANU almost 6 years ago

The real issue here is that the "- text wrongly interpreted as ordered list item" is interpreted as ordered list item instead of unordered. I'm going to report this issue to the redcarpet gem team because is not generated by Redmine.

Regarding the " - second child wrongly interpreted as code" it not quite an issue because of the blank line that precedes this line and the same behaviour is also on the marxico.

Actions #7

Updated by Marius BĂLTEANU almost 6 years ago

Marius BALTEANU wrote:

I'm going to report this issue to the redcarpet gem team because is not generated by Redmine.

https://github.com/vmg/redcarpet/issues/655

Actions #8

Updated by Marius BĂLTEANU about 2 years ago

  • File parse_lists.png added
  • Status changed from Confirmed to Closed
  • Resolution set to Fixed

The current Markdown implementation based on RedCarpet is deprecated, it is going to be dropped in the future versions and it will be replaced by the CommonMark Markdown (Github Flavoured) formatter that is available in Redmine 5.0.0 (#32424).

To fix this issue, you should migrate to the new engine which correctly parses the lists:

Actions #9

Updated by Marius BĂLTEANU about 2 years ago

  • Related to Feature #32424: CommonMark Markdown Text Formatting added
Actions #10

Updated by Marius BĂLTEANU about 2 years ago

  • File deleted (parse_lists.png)
Actions

Also available in: Atom PDF