md-to-pdf
md-to-pdf copied to clipboard
feature: Supporting marked plugins
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
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 🙃
Thanks a lot for the tip, I will check it out! Can I update this issue, if I figure something out?
Yes please!
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
Ok i'm planning to upgrade Marked though, would that solve the compatibility problem?
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. :)