mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-30 17:46:21 -04:00
Added support for specifying copied text for code blocks
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user