shabegom / buttons

Buttons in Obsidian
The Unlicense
455 stars 47 forks source link

Markdown in button names isn't rendered #52

Closed OliverBalfour closed 5 months ago

OliverBalfour commented 3 years ago

It would be super helpful to be able to add eg inline math equations to buttons, ie name $a^2+b^2=c^2$.

Currently it doesn't seem to support any markdown, but thankfully the Obsidian API makes this super easy! There's a MarkdownRenderer.renderMarkdown static function, and you can see how it's used for Kanban card items right here.

shabegom commented 2 years ago

renderMarkdown requires a bunch of arguments that I'd need to refactor for. Seems overly complex for some simple markdown -> html parsing.

shabegom commented 2 years ago

@OliverBalfour didn't quite get to Markdown rendering, but Buttons now render HTML tags, so it is a small start. If you know of any other plugin that takes in a string and outputs an HTML string without attaching the HTML to an element I can use it as an example.