Conflict with markdown-it-container
See original GitHub issueWhen using this plugin with markdown-it container all the attrs for the elements inside get’s merged with the attrs for the container unless there are more than one level of nested containers.
If I set attrs for a container, it get’s inserted on the container attrs array as expected. (needs custom render function but that’s a bug for the container plugin)
Example input:
::: column {.is-8}
Lorem ipsum
:::
Current output:
<div class="column is-8">
<p>Lorem ipsum</p>
</div>
But if I set attrs on the child, the attrs are set on the container:
::: column {.is-8}
# Some title here {.title}
Lorem ipsum
:::
It outputs:
<div class="column is-8 title">
<h1>Some title here</h1>
<p>Lorem ipsum</p>
</div>
Expected output:
<div class="column is-8">
<h1 class="title">Some title here</h1>
<p>Lorem ipsum</p>
</div>
When using nested containers it works as expected
:::: columns {.is-mobile}
::: column {.is-8}
# lorem ipsum {.title}
more lorem ipsum
:::
::::
outputs:
<div class="is-mobile columns">
<div class="is-8 column">
<h1 id="lorem-ipsum" class="title">lorem ipsum</h1>
<p>more lorem ipsum</p>
</div>
</div>
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
markdown-it-container - npm
Plugin to create block-level custom containers for markdown-it markdown parser. Latest version: 3.0.0, last published: 3 years ago.
Read more >high speed, pluggable parser for JS, with CommonMark support
I tried .use(require('markdown-it-container'), name); but that threw an error in my node.js app.
Read more >podman-container-cleanup
podman container cleanup cleans up exited containers by removing all ... IMPORTANT: Conflicts with --rmi as the container is not being cleaned up...
Read more >podman: .../markdown/podman-container-clone.1.md.in | Fossies
A hint: This file contains one or more very long lines, so maybe it is better readable using the pure text view mode...
Read more >Merge conflicts - GitLab Documentation
Use the merge conflict resolution editor to resolve complex conflicts in the GitLab interface: Go to your merge request. Select Overview, and scroll...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Attributes first, but I tested inverting the order and the result is the same.
I am using both extensions
markdown-it-attrs
andmarkdown-it-container
in conjunction with Marp in order to create my lecture slides.When combining both extensions, e.g.,
the
.source
class will be propagated to the definition container (the parent div) rather than to the paragraph that represents the source text.The problem as described in post #1 is still present to me.
I also tried the workaround proposed by @mb21 but it does not work in my setup.
Since I really like both extensions, I hope there is another way of making both work together.
Thanks in advance.