Created
September 25, 2022 14:41
-
-
Save JimmyLv/83607b010de2cec3a085bd23e1f697e9 to your computer and use it in GitHub Desktop.
自动提取飞书妙记的文本高亮,并复制到剪切板
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
贴回到 Bilibili https://gist.github.com/JimmyLv/896fee3a29357d8e9ef033cd036851c7