madflow / flow-netbeans-markdown

Markdown file support for the NetBeans IDE
MIT License
280 stars 41 forks source link

replace pegdown due to deprecation & end of life notice #121

Open marc-medley opened 7 years ago

marc-medley commented 7 years ago

On 2016.12.14, sirthias/pegdown posted a deprecation notice that "pegdown has reached its end of life."

The pegdown notice also gives reasons to consider @vsch's flexmark-java as a replacement.

madflow commented 7 years ago

Thanks for the heads up! @stengerh Maybe this should supersed #100 ? https://github.com/vsch/flexmark-java seems to be a good canditate - since it also supports (or even improves) parsing and token positions.

stengerh commented 7 years ago

Interesting. They have a pegdown migration helper for converting pegdown extension flags. We will have to check how different the API is.

For what it's worth I was mostly done with pegdown update. I still wanted to make the options page look nicer. Just before I saw the news about flexmark I had decided to split that into a separate feature branch. That way users could at least benefit from the newer pegdown version. I would still like to do this and suggest to release a new version of the plugin before the tackle the migration to a new markdown library.

marc-medley commented 7 years ago

As an FYI, the Apache Maven doxia-module-markdown had also reported problems with pegdown.

Apache Jira DOXIA-554: Parsing time for Markdown documents can take very long and hang site generation ... major bug.

Apache Jira DOXIA-554 Markdown issues were fixed with the switch to flexmark-java.

I contacted the flexmark-java author, Vladimir Schneider, in January when I discovered pegdown to be a serious problem for the projects I'm working on. He has been very helpful in migrations from pegdown to flexmark-java.

madflow commented 7 years ago

@stengerh I agree - if there is already substantial work done with the latest Pegdown release - we should create a new release with these changes. đź‘Ť Updating the options page sounds like a reasonable improvement!

Chris2011 commented 7 years ago

Great, see here the other stuff, what I commented: #54. Didn't know that there is already a ticket for this issue.

Chris2011 commented 7 years ago

To see flexmark or commonmark (which is much faster) updated in the plugin, will increase the usage of it. I guessing :D

marc-medley commented 7 years ago

Some observations for consideration:

Relative to intellij-markdown and pegdown, both commonmark-java and flexmark-java are in a "similar performance class": basic benchmarks here⇗. Both commonmark-java and flexmark-java are greater than a 20x overall performance improvement over pegdown.

Performance is just one of many features to consider: feature list here⇗.

For example, flexmark-java is a fork of commonmark-java⇗ which, among other things, was "modified to generate an AST which reflects all the elements in the original source".

(Opinion: The performance difference between commonmark-java and flexmark-java is not so significant when one considers how many more capabilities flexmark-java has.)

Also, Apache Maven Doxia has been refactored from pegdown to flexmark-java for release in Doxia version 1.8. [see DOXIA-554⇗]

IMHO, a Netbean Markdown Markdown plugin which aligns with Apache Maven Doxia Markdown 1.8, is more fully featured and 20x faster than pegdown would be an attractive update. ... ... thus, I would vote for flexmark-java over commonmark-java as an update of choice.

Chris2011 commented 6 years ago

Are there any plans to change the markdown parser? Would be great to have a new, faster and modern one.

Chris2011 commented 5 years ago

I don't know which one would be better flexmark or commonmark. But as for your statements @marc-medley it could be good to try out flexmark-java.

madflow commented 5 years ago

I believe the documented migration from Pegdown to Flexmark is the biggest bonus: https://github.com/vsch/flexmark-java#pegdown-migration-helper. Assuming that both provide an AST for syntax highlighting etc. Flexmark is used for the Jetbrains plugin - so it should be safe in that regard.

Chris2011 commented 5 years ago

I thought of removing pegdown dependency, looks what breaks (I think a lot) adding flexmark-java and changing the code. What do you think?

Chris2011 commented 5 years ago

I don't know the code base so help is much appreciate here.

madflow commented 5 years ago

Maybe you can start by replacing Pegdown just in the HTML Preview/Rendering part and see what breaks. This could break down the task a little. I would also expect to see quite some breakage when you try to target NB 11. This could also be a separate step. I can help with testing. @stengerh is the master of the code base ;) .