mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-10-04 16:46:00 +00:00
Compare commits
1 Commits
dependabot
...
5cd5a87823
Author | SHA1 | Date | |
---|---|---|---|
|
5cd5a87823 |
@@ -19,9 +19,9 @@ document
|
|||||||
.forEach((highlightDiv) => createCopyButton(highlightDiv));
|
.forEach((highlightDiv) => createCopyButton(highlightDiv));
|
||||||
|
|
||||||
async function copyCodeToClipboard(button, highlightDiv) {
|
async function copyCodeToClipboard(button, highlightDiv) {
|
||||||
const codeToCopy = highlightDiv.querySelector(
|
const codeToCopy = highlightDiv
|
||||||
"pre > code"
|
.querySelector("pre > code ")
|
||||||
).innerText;
|
.innerText.replace(/\n\n/g, "\n"); // This is needed to fix the double spacing
|
||||||
try {
|
try {
|
||||||
var result = await navigator.permissions.query({ name: "clipboard-write" });
|
var result = await navigator.permissions.query({ name: "clipboard-write" });
|
||||||
if (result.state == "granted" || result.state == "prompt") {
|
if (result.state == "granted" || result.state == "prompt") {
|
||||||
|
@@ -19,9 +19,9 @@ document
|
|||||||
.forEach((highlightDiv) => createCopyButton(highlightDiv));
|
.forEach((highlightDiv) => createCopyButton(highlightDiv));
|
||||||
|
|
||||||
async function copyCodeToClipboard(button, highlightDiv) {
|
async function copyCodeToClipboard(button, highlightDiv) {
|
||||||
const codeToCopy = highlightDiv.querySelector(
|
const codeToCopy = highlightDiv
|
||||||
"pre > code"
|
.querySelector("pre > code ")
|
||||||
).innerText;
|
.innerText.replace(/\n\n/g, "\n"); // This is needed to fix the double spacing
|
||||||
try {
|
try {
|
||||||
var result = await navigator.permissions.query({ name: "clipboard-write" });
|
var result = await navigator.permissions.query({ name: "clipboard-write" });
|
||||||
if (result.state == "granted" || result.state == "prompt") {
|
if (result.state == "granted" || result.state == "prompt") {
|
||||||
|
Reference in New Issue
Block a user