Commit ca5833e1 authored by Dheeraj Joshi's avatar Dheeraj Joshi

Disable copy-code button for mermaid diagrams

It removes the copy-code button for mermaid. The
button was added only for markdown code blocks.

Changelog: fixed
parent 015c466b
...@@ -30,6 +30,7 @@ class CopyCodeButton extends HTMLElement { ...@@ -30,6 +30,7 @@ class CopyCodeButton extends HTMLElement {
function addCodeButton() { function addCodeButton() {
[...document.querySelectorAll('pre.code.js-syntax-highlight')] [...document.querySelectorAll('pre.code.js-syntax-highlight')]
.filter((el) => el.attr('lang') !== 'mermaid')
.filter((el) => !el.closest('.js-markdown-code')) .filter((el) => !el.closest('.js-markdown-code'))
.forEach((el) => { .forEach((el) => {
const copyCodeEl = document.createElement('copy-code'); const copyCodeEl = document.createElement('copy-code');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment