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

Adding support or guide on marked extensions #96

Open
DJMogens opened this issue Jan 27, 2025 · 5 comments
Open

Adding support or guide on marked extensions #96

DJMogens opened this issue Jan 27, 2025 · 5 comments

Comments

@DJMogens
Copy link

Hi. Not sure if i am just incompetant and missed something, but i a feature request in my app to have alerts in the text like the ones github provides.

Should be possible with the marked extension here:

https://www.npmjs.com/package/marked-alert

How can i add this to the marked engine, and other extensions?

@jaysin586
Copy link
Contributor

I will take a look over the next few days and give it some thought :)

@jaysin586
Copy link
Contributor

jaysin586 commented Jan 28, 2025

@DJMogens Ok, so here is what I can gather from your request and where the project currently is.

Svelte-Markdown was built off of the marked lexer and not the marked engine. This means we get back tokens, and it does not include the plugins from what I can gather in my limited testing yesterday.

We introduced htmlparser2 as lots of the previous requests from the other package were because of HTML not showing in markdown.

I believe, I know I did, that people choose this library because it does NOT include the @html syntax to just spit out the HTML, and they like control over the output.

I believe this would leave us in a forked position on if we parse the full thing together, or if we parse the tokens then do the HTML like we currently are.

Here is a REPL with what I mean from the above. If you could double check it and ensure I am playing with marked-alert properly (I have not used the library). If I am, then I will come up with a solution for the issue but maybe I am missing something 🤷‍♂️

Thank you for your time, and let me know your thoughts!

@DJMogens
Copy link
Author

Thanks for looking into it. I also saw some people getting to actually inject the extensions, but it is getting a bit hacky :/

pablo-abc/svelte-markdown#17 (comment)

Currently looking into Carta, which might fit my use case better.

@jaysin586
Copy link
Contributor

@DJMogens Let me know if it does not fit your needs and I will come up with a plan to get it to work for you!

@jaysin586
Copy link
Contributor

@DJMogens did you get Carta to do what you need? Or do you want me to take a stab at it?

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

No branches or pull requests

2 participants