-
Notifications
You must be signed in to change notification settings - Fork 9
Unintended content has 'Copy' button #1
Comments
Ah yes, this is because tabbing a paragraph in markdown treats it as a code block. But I can make the copy button NOT show for blocks without a language. Will do that soon |
I have some code blocks without a language (eg. AdBlock filters). Is there no other distinction between the two types of code blocks? |
Thats right, a tabbed code block and a fenced code block are indistinguishable in the rendered view. So my plan is: |
Make the copy button nicer using an SVG icon
A bit too late, but maybe this will help someone. If you just want to remove that "Copy" button, add the following to the // Remove "Copy" button
if (pre.children.length > 1 && pre.children[1].tagName === 'BUTTON') {
pre.children[1].remove();
} Also, you can add the toast notification on copy, like the original button does, just add this inside the new Notice('copied to your clipboard'); |
Love the plugin, just noticed this though:
not inside a code fence, just indented with a tab and it is being treated as code, is the intended behavior?
The text was updated successfully, but these errors were encountered: