Added support for specifying copied text for code blocks

This commit is contained in:
squidfunk
2023-10-05 17:26:24 +02:00
parent 57e598b96e
commit 48ff39a5cc
4 changed files with 7 additions and 7 deletions

View File

@@ -55,7 +55,7 @@ interface SetupOptions {
*/
function extract(el: HTMLElement): string {
el.setAttribute("data-md-copying", "")
const text = el.innerText
const text = el.getAttribute("data-clipboard-text") ?? el.innerText
el.removeAttribute("data-md-copying")
return text
}