fix(snippets): use regex to strip encoding from copied text
This commit is contained in:
parent
a5025eeaab
commit
8e8f74df97
1 changed files with 4 additions and 1 deletions
|
|
@ -166,7 +166,10 @@ const shikiCopyButton: ShikiTransformer = {
|
|||
role: "button",
|
||||
"aria-label": "Copy to clipboard",
|
||||
"alia-live": "polite",
|
||||
"data-code": this.source,
|
||||
"data-code": this.source.replace(
|
||||
/TYPE99(\w+.)99TYPE/g,
|
||||
(_full: string, match: string) => getQMLTypeLinkObject(match).name,
|
||||
),
|
||||
onclick: `
|
||||
navigator.clipboard.writeText(this.dataset.code);
|
||||
this.classList.add('copied');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue