Fix various mermaid bugs (#36547)
* Fix #36515 * Fix #23076 * Remove unnecessary `mermaid.parse` * Fix data race when using `data-render-done` * Remove unnecessary `Promise.all` * Fix duplicate `load` event and duplicate SVG node rendering * Remove unnecessary `IntersectionObserver` * Add `bindFunctions` call, the old comment seems not true
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import {svg} from '../svg.ts';
|
||||
import {queryElems} from '../utils/dom.ts';
|
||||
|
||||
export function makeCodeCopyButton(): HTMLButtonElement {
|
||||
export function makeCodeCopyButton(attrs: Record<string, string> = {}): HTMLButtonElement {
|
||||
const button = document.createElement('button');
|
||||
button.classList.add('code-copy', 'ui', 'button');
|
||||
button.innerHTML = svg('octicon-copy');
|
||||
for (const [key, value] of Object.entries(attrs)) {
|
||||
button.setAttribute(key, value);
|
||||
}
|
||||
return button;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user