Skip to content

Migration generator: loose lists get mangled #1355

Open
@rparrett

Description

@rparrett

It seems that a list with a line break between two items is considered a "loose list"

- a

- b

Becomes this:

Start(List(None))
Start(Item)
Start(Paragraph)
Text(Borrowed("a"))
End(Paragraph)
End(Item)
Start(Item)
Start(Paragraph)
Text(Borrowed("b"))
End(Paragraph)
End(Item)
End(List(None))

when parsed by pulldown_cmark. This is normal/expected behavior.

Because we emit line endings for Paragraph tag start/end, the final markdown ends up being:

-
a

-
b

Which is rendered like this:


a

b


Here's an example in the wild:
https://github.com/bevy/bevy-website/blob/39fcf9589e236e8779b6488a2db6639a3e68a5f3/release-content/0.14/migration-guides/11989_Implement_the_AnimationGraph_allowing_for_multiple_animati.md?plain=1
(this was fixed manually in #1344)

I am not really sure how to work around this, but if I find time I may try to

  • Not emit line breaks for the first paragraph start event for a particular list item
  • Add indentation for subsequent paragraphs in a list item on the paragraph start event

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Migration GuidesC-AutomationTools to make repetitive tasks easierC-BugA problem with the code that runs the site

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions