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

feature: Supporting marked plugins #292

Open
tothlp opened this issue Apr 4, 2024 · 6 comments
Open

feature: Supporting marked plugins #292

tothlp opened this issue Apr 4, 2024 · 6 comments
Labels

Comments

@tothlp
Copy link

tothlp commented Apr 4, 2024

Problem:

Marked has some pretty awesome plugins, like alert and footnote, but I can't get to figure out how to use them with md-to-pdf. I believe that upgrading the marked library is needed.

Solution:

I want to be able to use marked extensions. see: https://github.com/bent10/marked-extensions?tab=readme-ov-file#packages

@tothlp tothlp added the feature label Apr 4, 2024
@simonhaenisch
Copy link
Owner

simonhaenisch commented Apr 5, 2024

I think it's basically this: #228.

With a .js config file you can already use extensions IIRC, via the marked_extensions config option, but I don't remember how it works exactly 🙈 you can probably find some info by searching the issues (:

Upgrading Marked is also on the todo list. I don't receive any sponsoring for this project so things take a while at this point with small children at home 🙃

@tothlp
Copy link
Author

tothlp commented Apr 8, 2024

Thanks a lot for the tip, I will check it out! Can I update this issue, if I figure something out?

@simonhaenisch
Copy link
Owner

Yes please!

@tothlp
Copy link
Author

tothlp commented Apr 9, 2024

I'm afraid, that the plugins that can be passed to marked.use() are limited by the given marked version number. As I see these are the supported plugins for marked version 4.2.12. (I believe that is what md-to-pdf uses). So I think that alert and footnote can not be used with this.

https://github.com/markedjs/marked/blob/v4.2.12/docs/USING_ADVANCED.md#known-extensions

@simonhaenisch
Copy link
Owner

Ok i'm planning to upgrade Marked though, would that solve the compatibility problem?

@tothlp
Copy link
Author

tothlp commented Apr 27, 2024

I'm sorry, I did not see that comment somehow. Yes, I believe, it would. I am not an expert at all with these libs as I develop mainly in Kotlin, but I think it is worth a try. :)

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

No branches or pull requests

2 participants