tommilligan / mdbook-admonish

A preprocessor for mdbook to add Material Design admonishments.
MIT License
171 stars 18 forks source link

Using other markdown or html in titles #179

Closed s00500 closed 3 months ago

s00500 commented 3 months ago

Hi, awesome tool!

Question, is it possible to somehow use markdown or html formating within titles ?

EG

admonish tip title="Some New Structure my_structure"

Any way to achieve this currently ?

Greetings,

s00500 commented 3 months ago

Sorry for the issue.... mostly this is solved by using tildes for outer fence as per documentation

https://tommilligan.github.io/mdbook-admonish/#nested-markdownhtml

What I can not make work though is using a html element with a class in there

~~~ admonish block title="Value <div class="advanced"></div>"

Maybe you know the correct escape ?

tommilligan commented 3 months ago

Hi, thanks for the report. I agree this is something that should be supported, but I can't get it to work immediately and the error message displayed on failure is not helpful.

I'll take a look and see if I can improve the error handling enough to work out what the correct syntax is, then let you know.

s00500 commented 3 months ago

Awesome! thanks!

tommilligan commented 3 months ago

Hi, this should be fixed by #181

If you're able to, please install from git directly and see if it fixes your use case:

cargo install --git https://github.com/tommilligan/mdbook-admonish --branch main

I'll cut a 0.17.0 release with the fix after a few other things.

tommilligan commented 3 months ago

And sorry to clarify, for your HTML example this should render correctly on main:

```admonish block title='With <div class="advanced">HTML</div>'
Body content
s00500 commented 3 months ago

This is great, I have just tested it successfully! Thanks for the insanely fast fix