creecros / MarkdownPlus

Improved Markdown, with check boxes, emoji shortcode, inline html, etc...
MIT License
52 stars 15 forks source link

Markdown sub bullet points syntax is changed (⇒ breaking old content layout) #14

Open oliviergenest opened 1 year ago

oliviergenest commented 1 year ago

Please see: https://github.com/kanboard/kanboard/issues/5168 I am facing this issue and it has been reported that removing MarkdownPlus fixes the issue. So probably this plugin is involved in the issue. What do you think?

Summary of the issue (more detailed here): sub-bullet were created with only one whitespace before *. Now, two whitespaces are required, causing the old comments to be wrongly displayed (sub-bullets displayed as bullets).

Thanks!

creecros commented 1 year ago

hmmm, this one might take me while to research. it's clearly not happening in parsedown, since parsedown alone is not the issue. it's all vendor libraries, so ill need some time to review and figure out which one is doing it.

creecros commented 1 year ago

ya, so im not crazy in thinking this, and i will still look into it. But I never caught this because I don't think this is normal markdown behavior. I have always used 2 spaces to make a sublist, never 1.

* test
 * test

and as you can see above, 1 does not even work in github. So I could just as easy say that Kanboard has the issue.

So I guess it could actually be a parsedown problem, because Markdownplus is using the latest version, vs kanboard which uses an old ass version...

oliviergenest commented 1 year ago

OK thanks for the feedback! So probably I should better migrate all my database to "two spaces before star" instead of "one space before star". I just need to find the proper regexp and SQL query 🙂

creecros commented 1 year ago

I wouldn't go that far just yet. I'm still going to look into it and if it is a simple fix I might be able to do something. If however it requires me to alter a vendor library, it just comes down to a "should I" or "shouldn't I", as it means any libraries that need updating in the future no longer become as simple as composer update....if that makes sense.

creecros commented 1 year ago

OK, so I can say that the difference is infact the difference between the parsedown versions. Kanboard uses Parsedown 1.7.4, MarkdownPlus uses Parsedown 1.8.0-beta-7

The blockListContinue() function logic is very different between the 2.

In 1.7.4, the sublist must be indented by at least one space more than the parent list item.

In 1.8.0-beta-7, the sublist must be indented by the length of the marker plus one space more than the parent list item.

Unfortunately, 1.8.0-beta-7 is the minimum version for parsdown-checkbox, so it is not an easy change, unless parsedown checkbox is either updated, or I make my own version that works with 1.7.4....I don't really want to do that tbh.

I will however keep the issue open, and add it to the Readme, so people will at least be aware of the difference.

I will offer a solution for you though, you can just edit the vendor library code yourself to change the indent requirement.

oliviergenest commented 1 year ago

Thanks for the detailed analysis! Your proposition seems reasonable.