Skip to content
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

Code blocks error #39

Open
lazybobcat opened this issue Mar 23, 2024 · 1 comment
Open

Code blocks error #39

lazybobcat opened this issue Mar 23, 2024 · 1 comment

Comments

@lazybobcat
Copy link

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.

@DomeT99
Copy link

DomeT99 commented Jun 9, 2024

Hi guys!
If you want, I can handle this problem when I have time.
Let me know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants