markdown-it / markdown-it-container

Fenced container plugin for markdown-it markdown parser
MIT License
496 stars 74 forks source link

feature: Container Ids #28

Closed LukeTOBrien closed 5 years ago

LukeTOBrien commented 5 years ago

Hello there,

I would like to add ids to my containers, but at the moment only classes can be added.
The syntax I would like to use is a hash (#) followed by the id, like so:

::: #container
:::

However this currently renders as a class rather than the id as I would like.

<div class="#container">
</div>

This is what I would like:

<div id="container">
</div>

How easy would this feature be to add and do you this is would be a useful addition?

puzrin commented 5 years ago

Just override default renderer function with your own.