betterRunner/context-note

Retaining rich format and/or links for highlighted text?

jmatthewpryor opened this issue · 7 comments

Hi,
It seems that when highlights are created, the retained text is just plan text. I expect this is a feature

Did you give any thought to retaining the highlight with format? Retaining links <a href/> would be particularly important for the use case I am pursuing

Thanks

Thanks for the nice suggestion!
I think retaining the links of the selected text is possible and I would like to add this feature.
As for the rich format, some tests might need to be done to verify if it is accessible since it relates to css and other details. I would post here if any progress.

Thanks - I am very happy to help test. I am trying to get set up to use the extension in dev mode (no success so far)

FWIW I otherwise use Roam Highlighter which does a very good job of converting highlighted web content into markdown that can be pasted into a Roam graph.

https://chrome.google.com/webstore/detail/roam-highlighter/hponfflfgcjikmehlcdcnpapicnljkkc?hl=en

I just did a quick experiment with https://github.com/mixmark-io/turndown and it worked well

/*
 * Get the texts list from an node.
 */
function getNodeTextList(node: DocumentFragment): string[] {

 [ SNIP LOTS OF CODE ]

  let turndownService = new TurndownService();

  return [turndownService.turndown((node as unknown) as HTMLElement)];

Thanks, I would try https://github.com/mixmark-io/turndown to see if it works. By the way, I want to confirm if your need is to show the selected text with rich format in the note book of context-note itself or need to copy to clipboard then you can paste to other markdown platforms like Roam graph?

"I am trying to get set up to use the extension in dev mode (no success so far)", just run yarn dev, and then import the dist folder into chrome extension by following https://support.google.com/chrome_webstore/answer/2664769?hl=en

thanks - I got it working & can load in my browser & test

I don't need the highlighting to handle the rich test - just keep it - even just retain is as a separate Markdown attribute so it can be exported

Hi @jmatthewpryor, sorry that I ruminated over and decided not to support this feature for keeping the simplicity of the note-book. If we need to get the details (rich format, links, etc.), we can just jump back to the context of this note then you can copy it or use other extensions (Roam Highlighter, etc.) to do further operations.

By the way, there was a bug that the highlight block would hamper the click event of the original links of text and I have fixed it by #35.

I gonna close the issue here and please feel free to reopen it if you have different views.