Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
marc-medley opened this issue Mar 17, 2017 · 13 comments
Open

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

marc-medley opened this issue Mar 17, 2017 · 13 comments

Comments

@marc-medley
Copy link

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
Copy link
Owner

madflow commented Mar 18, 2017

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
Copy link
Collaborator

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
Copy link
Author

marc-medley commented Mar 25, 2017

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
Copy link
Owner

madflow commented Apr 20, 2017

@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
Copy link

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

@Chris2011
Copy link

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

@marc-medley
Copy link
Author

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
Copy link

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

@Chris2011
Copy link

Chris2011 commented Apr 25, 2019

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
Copy link
Owner

madflow commented Apr 26, 2019

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
Copy link

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
Copy link

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

@madflow
Copy link
Owner

madflow commented Apr 27, 2019

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 ;) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants