web-companion icon indicating copy to clipboard operation
web-companion copied to clipboard

Feature: filter links in `#current` note

Open bberberov opened this issue 1 year ago • 3 comments

I recently started using the browser extension with QOwnNotes. The #current tag feature is very nice, but it creates an all-or-nothing list of all links in the current note. It would be useful if some links could be filtered out; they are useful in the note itself, but not when viewed through the extension.

Two cases:

  • Filter out all the file:// links. A global preference would be fine.
  • Allow other tags in combination with #current. Right now other tags from the note are not usable.

Expected behaviour

Some possibility of filtering links

Actual behaviour

All links from the current note are listed

Steps to reproduce

  • Create a note with some file:// links, and some tags like #local.
  • Open current note through browser extension

Output from the debug section in the settings dialog in QOwnNotes

Relevant log output in the Log panel in QOwnNotes

bberberov avatar Oct 22 '24 19:10 bberberov

Filter out all the file:// links. A global preference would be fine.

Ah, thank you. I think I will filter them out unconditionally in QOwnNotes itself. Don't make a lot of sense for portability.

Allow other tags in combination with #current. Right now other tags from the note are not usable.

Could you please explain what you mean by "Right now other tags from the note are not usable."?

I created a note with

- [file link](file:///home/user/somefile.txt) #sometag

Then I filtered by #sometag.

pbek avatar Oct 23 '24 05:10 pbek

Ah, thank you. I think I will filter them out unconditionally in QOwnNotes itself. Don't make a lot of sense for portability.

Please don't filter them out unconditionally! Firefox supports file:/// with some very useful behaviors. HTML and XML (with XSLT) files load without having to run a web server, and directories display an index page. I use them a lot and I'd rather filter them out with tags when needed.

I think I figured out the issue with the tags.

This will display the link and tag in the extension interface:

paragraph

- [file link](file:///home/user/somefile.txt) #sometag

paragraph

But this will display only the link, and not parse the tag, even if it's its own paragraph or heading:

paragraph

[file link](file:///home/user/somefile.txt) #sometag

paragraph

I didn't realize the subtlety in the syntax. Could you add a note in the documentation that tags are only parsed in lists, but links are parsed everywhere.

By the way, excellent application! Incredibly performant on older hardware. Appreciated.

bberberov avatar Oct 24 '24 00:10 bberberov

But this will display only the link, and not parse the tag, even if it's its own paragraph or heading:

The "normal" bookmark links need to be in lists, see https://www.qownnotes.org/getting-started/browser-extension.html#syntax-of-bookmark-links

The 2nd link just gets picked up as a random link in a sentence, like This is a [file link2](file:///home/user/somefile2.txt) in a sentence..

By the way, excellent application! Incredibly performant on older hardware. Appreciated.

Thank you! 😉

pbek avatar Oct 24 '24 04:10 pbek

2024.12.0

  • There now is a new switch in the drawer menu to hide bookmarks and links from the current note (for #70)
    • Bookmarks can still contain the Current tag, for example if the current note is a bookmark note
    • This feature needs QOwnNotes 24.12.7 or higher

pbek avatar Dec 27 '24 14:12 pbek

QOwnNotes 24.12.7

pbek avatar Dec 27 '24 15:12 pbek

There now is a new release, could you please test it and report if it works for you?

pbek avatar Dec 27 '24 15:12 pbek

I didn't find any problems with it so far.

bberberov avatar Jan 06 '25 00:01 bberberov