s0 / remark-code-extra

Add to or transform the HTML output of markdown code blocks using remark
MIT License
24 stars 4 forks source link

Code blocks not being wrapped in code-extra div #16

Closed fitzage closed 2 weeks ago

fitzage commented 2 weeks ago

I'm not really sure what's going on here, but I tested this in one repo and then added it to another repo with my complex config. The stuff I'm adding in the config shows up in both, but in the second repo, the code blocks don't get wrapped in div class="code-extra".

There aren't a lot of differences between the two, but the newer one is using a newer mdx. Upgrading the older repo to @astrojs/mdx 3.1.7 to match seems to result in the same problem, although reverting it didn't seem to work either (but maybe I didn't revert it properly).

fitzage commented 2 weeks ago

OK, now that I did it properly, reverting to mdx 2.3.1 that the older repo was using solved the problem, so it seems that this is an issue with how code-extra works with mdx.

Although downgrading mdx in the newer repo doesn't help, so maybe there are other things at play.

fitzage commented 2 weeks ago

Oof, this is stupid. I realized it’s because the wrapping div only shows up if I’m adding an element before the code block. I need to figure out how to wrap all code blocks no matter what.