remcohaszing / rehype-mermaid

A rehype plugin to render mermaid diagrams
MIT License
80 stars 8 forks source link

Please consider add data-language=mermaid attribute support for pre tag #20

Closed bojieyang closed 4 months ago

bojieyang commented 5 months ago

The astro framework generate md(x) mermaid code block like below:

<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" 
   data-language="mermaid">
   <code>
   ....
  </code>
</pre>

but right now rehype-mermaid only support:

<pre class="mermaid"> and <code class="language-mermaid">

Please consider support data-language attribute for pre tag or other way to support it .

remcohaszing commented 5 months ago

This looks like a problem in Astro then, or more likely in something else you use with Astro. Please provide a repo with a minimal reproduction.