Skip to content

Instantly share code, notes, and snippets.

@JimmyLv
Created September 25, 2022 14:41
Show Gist options
  • Save JimmyLv/83607b010de2cec3a085bd23e1f697e9 to your computer and use it in GitHub Desktop.
Save JimmyLv/83607b010de2cec3a085bd23e1f697e9 to your computer and use it in GitHub Desktop.
自动提取飞书妙记的文本高亮,并复制到剪切板
copy(
[...document.querySelectorAll(".p-right-area")]
.map((e) => {
const highlights = e.querySelectorAll(".highlight-background");
if (highlights.length === 0) {
return;
}
const timestamp = e.querySelector(".p-time").getAttribute("time-content");
const highlight = [...highlights].map((e) => e.textContent).join("");
return `${timestamp} ${highlight}`;
})
.filter((t) => t)
.join("\n\n")
);
@JimmyLv
Copy link
Author

JimmyLv commented Oct 28, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment