Markdown: Leading spaces of list items are removed when merged

Issue #738 new
Kuro Kurosaka created an issue

When a list item has one or more leading items, they are removed when the document is merged.

For example:

  * Bullet item 1
  * Bullet item 2

becomes

* Bullet item 1
* Bullet item 2

This was discovered in okapi-integration-tests. The round trip tests of example1.md and example2.md are failing, and one of the cause is this.

Comments (6)

  1. Deepak

    @ssikuro I tried running the attached file without my changes (pull request #245), but still the leading spaces are being removed. My pull request doesn't include any changes to the bullet list (or ordered list) node handler. The spaces are being removed from the md parser. I have tested the behavior on windows machine.

  2. Kuro Kurosaka reporter

    You are right, @deeagraw. I have verified this is happening as early as commit 92d22f8 (not the earliest; I haven't pinned down a commit). I am very sorry to have suspected pull request 245. It was based on an uncofirmed report that the test was passing in June and there wasn't other major code changes in Markdown.

  3. Kuro Kurosaka reporter

    I am coming to a conclusion that this kind of changes in number of spaces should be acceptable, as long as the resulting file has exactly the same meaning (rendering result) as the original when rendered by Markdown engines.

    The Markdown implementation uses the FlexMark-java parser that was designed to parse Markdown documents and it does not try to preserve the spaces that are optional from the Markdown point of view.

  4. Log in to comment