Adding information about the function of copy buttons for screenreaders, etc

This commit is contained in:
Adam Brangenberg 2022-12-29 13:40:46 +01:00
parent 44072e7494
commit 45ac46c0b6

View File

@ -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(