mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-24 15:05:42 -05:00
Adding information about the function of copy buttons for screenreaders, etc
This commit is contained in:
parent
44072e7494
commit
45ac46c0b6
@ -20,6 +20,7 @@ const addCopyButtons = () => {
|
||||
button.className = "clipboard-button";
|
||||
button.type = "button";
|
||||
button.innerHTML = svgCopy;
|
||||
button.ariaLabel = "opy the shown code";
|
||||
// remove every second newline from lastCodeBlock.innerText
|
||||
button.addEventListener("click", () => {
|
||||
navigator.clipboard.writeText(lastCodeBlock.innerText.replace(/\n\n/g, "\n")).then(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user