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

Copy button not working after an error #65

Closed
bilgeyucel opened this issue Dec 27, 2022 · 0 comments · Fixed by #68
Closed

Copy button not working after an error #65

bilgeyucel opened this issue Dec 27, 2022 · 0 comments · Fixed by #68
Assignees

Comments

@bilgeyucel
Copy link
Collaborator

In a tutorial, I want to create a code block without any code highlight and without a copy button such as:

/doc-search
└── docker-compose.yml

However, not providing a programming language breaks the script that adds the COPY buttons to code blocks. That's why we don't see COPY buttons on code blocks after the one I shared above.
A try-catch block like below in code-copy-buttons.js solves this problem but probably there is a better approach.

    try {
      codeBlock.parentNode.insertBefore(button, codeBlock.parentNode.nextSibling);
    } 
    catch(e){
      console.log(e)
    }
@TuanaCelik TuanaCelik linked a pull request Dec 30, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants