-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Support markdown-it-containers #72
Comments
For what purpose would you use this? |
I use markdown-pdf with my own project mdss (https://github.com/vimtaai/mdss). It allows me to use container blocks to do things like centering text or floating images or create colored boxes. |
Is it OK with the following specifications?
and
I support markdown-it-container. |
I think the original plugin doesn't require adding the "class" keyword to containers.
<div class="warning">
<p><em>here be dragons</em></p>
</div> But it is also looks good as it is. |
@vimtaai .use(require('markdown-it-container'), name [, options]); However, I think that it is necessary to hard code the name parameter. So I fixed the value of the
If possible, I would like to make it the same as the original specification, but is there any good way to do it? |
@yzane .use(markdownItContainer, '', {
validate(name) {
return name.trim().length;
},
render(tokens, idx) {
if (tokens[idx].info.trim() !== '') {
return `<div class="${tokens[idx].info.trim()}">`;
} else {
return `</div>`;
}
}
}); This usage corresponds to the way to how pandoc's container blocks work. |
@vimtaai Thank you very much. |
@vimtaai Please upgrade to Markdown PDF ver1.2.0 and try it |
Hi, {
validate: () => true,
render: function (tokens, idx) {
if (tokens[idx].type === 'container__open') {
const classList = tokens[idx].info.trim()
return `<div ${classList ? `class="${classList}"` : ``}>`
} else {
return `</div>`
}
}
} It allows empty |
I'm really happy with this extension so far. Would you perhaps consider adding a mechanism to allow us to customize the rendering for the As a rough idea, perhaps a settings that allows us to point to a In my case, I'd like to emit some custom HTML when I use |
Hi, For exemple,
renders: Some warning With no style at all. |
I'm having this problem as well |
Hello @yzane, do you have any ideas on the above? I'm facing it too. |
Hi,
It would be nice to have support for markdown-it containers via the https://github.com/markdown-it/markdown-it-container plugin. Any chance that you add support for this?
The text was updated successfully, but these errors were encountered: