ev0-astro-theme
ev0-astro-theme copied to clipboard
Code blocks error
Hello, I have an issue on the code blocks and so does the theme preview at this URL: https://ev0.gndx.dev/blog/markdown-style-guide/
Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
The error comes from the Code.astro
file, the variable button
and check
are null
:
codeBlock.forEach((code) => {
const button = code.querySelector(".copy-button");
const check = code.querySelector(".check-span");
It looks like the component expect the button to be there, but for some reason in the HTML the code block actually looks like
<pre class="astro-code material-theme-palenight" style="background-color:#292D3E;color:#babed8; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;" tabindex="0">
<!-- ... contents ... -->
</pre>
I have no idea where this HTML comes from as I cannot find any reference to the class astro-code
in the codebase.
Hi guys! If you want, I can handle this problem when I have time. Let me know :)