VojtaStruhar / goldmark-obsidian-callout

Goldmark extension for obsidian-flavored callouts
MIT License
4 stars 0 forks source link

goldmark-callout #1

Open chovanecadam opened 4 months ago

chovanecadam commented 4 months ago

Hi! Thanks for the extensions, it's great to see support for Obsidian coming to markdown parsers. I didn't search enough for this repository and wrote my own extension before realizing that this already existed. I took a slightly different approach, utilizing parser instead of AST transformer. Our extensions have roughly the same feature sets - I don't support open-by-default and forced-open callouts yet and you don't handle block elements in callouts (e.g. lists).

I just came to say hello. My project lives here https://gitlab.com/staticnoise/goldmark-callout if you're interested.

VojtaStruhar commented 4 months ago

Hey! Thanks for reaching out. Having a parser is much cleaner than the AST transformer, but I just couldn't get it to register the callbacks properly for some reason 🤔 Skill issue, probably

I noticed you are rendering the collapsible callouts as <details><summary>, which makes perfect sense, but Obsidian renders it into a div and supplies the interactivity with React. So I later abandoned this route and went into rendering them as divs, just so that the resulting HTML has full CSS compatibility with themes.. sigh. So this project is a little bit abandoned at the moment 😢

Keep it up and good luck!