heyman / heynote

A dedicated scratchpad for developers
https://heynote.com
Other
3.86k stars 194 forks source link

Feature request: Convert hyperlinks to markdown when pasting into markdown block #182

Open korniko98 opened 7 months ago

korniko98 commented 7 months ago

Have you searched existing Github issues to see if someone has already requested this feature? Yes

Is your feature request related to a problem? Please describe. I would like to copy text including hyperlinks into heynote markdown blocks but links are interpreted as text rather than hyperlinks. This means that information about the links is lost when pasting.

Describe the solution you'd like I would like heynote to convert hyperlinks to markdown when pasting into a markdown block.

Describe alternatives you've considered In the meantime I'm copying text to notion (which does the abovementioned conversion) and from there to heynote.

heyman commented 7 months ago

This sounds useful, but it's not a super trivial fix.

Currently, Heynote uses navigator.clipboard.readText() to get the clipboard contents. I assume we would need to read the HTML content instead, and then use something like turndown to turn it into Markdown (if all cursors are inside a Markdown block).