blackfriday icon indicating copy to clipboard operation
blackfriday copied to clipboard

Indented Block Quote in a list is not parsed as a child to the list item.

Open lonnblad opened this issue 5 years ago • 3 comments

An indented Block Quote, a Paragraph and a List within a List Item are not parsed as children to that List Item.

markdown

* Foo

  > Bar

  Foo

  - Bar

expected node.Walk

Document
  List
    Item
      Paragraph
        Text
        Emph
          Text
        Emph
        Text
      Paragraph
      BlockQuote
        Paragraph
          Text
        Paragraph
      BlockQuote
      Paragraph
        Text
      Paragraph
      List
        Item
          Paragraph
            Text
          Paragraph
        Item
      List
    Item
  List
Document

actual node.Walk

Document
  List
    Item
      Paragraph
        Text
        Hardbreak
      Paragraph
    Item
  List
  BlockQuote
    Paragraph
      Text
    Paragraph
  BlockQuote
  Paragraph
    Text
  Paragraph
  List
    Item
      Paragraph
        Text
        Hardbreak
      Paragraph
    Item
  List
Document

lonnblad avatar Jul 31 '19 10:07 lonnblad

found that indenting with two extra spaces gave what I expected

* Foo

    > Bar

    Foo:

    - Bar

lonnblad avatar Jul 31 '19 10:07 lonnblad

Glad to have the workaround, but to maximize the readability of the source Markdown (surely one of the major points of using Markdown in the first place!) it would be nice to have the GFM behavior of just having to match the indent of the list item, and not requiring extra newlines.

- in an unordered list
  > indent the child item two spaces
1. in an ordered list
   > indent the child item three spaces
  • in an unordered list

    indent the child item two spaces

  1. in an ordered list

    indent the child item three spaces

dmoles avatar Nov 26 '19 03:11 dmoles

Doubly indented lists have a similar problem:

- level 1
- level 1
  - level 2
    - level 3
    - level 3
  - level 2

Should produce something like:

  • level 1
  • level 1
    • level 2
      • level 3
      • level 3
    • level 2

with the structure:

<ul>
    <li>level 1</li>
    <li>level 1
        <ul>
            <li>level 2
                <ul>
                    <li>level 3</li>
                    <li>level 3</li>
                </ul>
            </li>
            <li>level 2</li>
        </ul>
    </li>
</ul>

but instead produces:

  • level 1
  • level 1
    • level 2
    • level 3
    • level 3
    • level 2

with the structure:

<ul>
    <li>level 1</li>
    <li>level 1
        <ul>
            <li>level 2</li>
            <li>level 3</li>
            <li>level 3</li>
            <li>level 2</li>
        </ul>
    </li>
</ul>

dmoles avatar Nov 26 '19 03:11 dmoles