tsujan / FeatherNotes

Lightweight Qt Notes-Manager for Linux
GNU General Public License v3.0
109 stars 22 forks source link

Links investigation #254

Closed ghost closed 2 years ago

ghost commented 2 years ago
  1. Creating a link makes it underlined + italic.     -> Is italic really necessary ? Not sure it improves readability (personal taste).

  2. Pasting a raw url with Ctrl+V or Ctrl+Shlft+V does not make any difference.    -> proposal: Ctrl+Shlft+V should create the hyperlink

tsujan commented 2 years ago
  1. That's just the default format. The user could change it later, in any way he/she likes.
  2. With Ctrl+Shlft+V, the link is also pasted. The default link format is only for the links created by the user explicitly.
ghost commented 2 years ago

The user could change it later, in any way he/she likes.

Of course. Easy for 1 operation. More boring for 50 operations....

That's just the default format.

That's the default format of exactly what ? Qt libs ? or Fnotes code ? I did not find this italic link setting in the code. I've never seen this default italic link setting in any other Qt apps (even Gtk). If it is in Fnotes code, please guide me to identify in which file.

With Ctrl+Shift+V, the link is also pasted.

Yes, pasted as raw text, no difference at all with Ctrl+V, reason why I proposed to translate a raw url to hyperlink with Ctrl+Shift+V (small improvement I supposed easy, sorry for my wrong estimation).

The default link format is only for the links created by the user explicitly.

Any reason for that ? Not clear to me to understand the difference between a pasted url without italic, and created url with italic.

tsujan commented 2 years ago

That's the default format of exactly what ?

Your question sounds strange. It's the default format I have chosen, in the code.

Yes, no difference at all with Ctrl+V.

They're totally different. The text editor doesn't accept rich text with Ctrl+V.

Any reason for that ?

Yes.

ghost commented 2 years ago

Your question sounds strange. It's the default format I have chosen, in the code.

As I did not find this setting in your code I supposed it came from a default Qt libs setting.

They're totally different. The text editor doesn't accept rich text with Ctrl+V.

Exactly the same ... as result for the user ! Ctrl+V -> https://github.com/ Ctrl+Shift V -> https://github.com/

Any reason for that ?

Yes.

Short answer, although not clear to me. But OK. Thanks.

tsujan commented 2 years ago

Exactly the same ... as result for the user !

There should be a misunderstanding here. https://github.com/ is not a link but a text. Copy "tsujan/FeatherNotes" from the top left corner of this page.

tsujan commented 2 years ago

An https:// doesn't magically insert a link into a text. Plain-text editors (like FeatherPad) may mark the whole string as a link because they don't support link insertion. In rich-text editors, a link is an HTML property; it either exists or not.

ghost commented 2 years ago

There should be a misunderstanding here.

First message:

  1. Pasting a raw url with Ctrl+V or Ctrl+Shlft+V does not make any difference. -> proposal: Ctrl+Shlft+V should create the hyperlink

To reformulate, as clearly as I can: I proposed to convert the pasted text https://github.com to hyperlink with Ctrl+Shit+V, to make a difference with Ctrl+V .

But forget it. I will do with it and investigate the code as deep as I can to understand.

I will also read the documentation again to clarify why a created link should be Italic, and not a pasted link. Totally new to me / never seen in any other note tacking apps.

Thanks anyway.

tsujan commented 2 years ago

I proposed to translate the pasted text https://github.com to hyperlink with Ctrl+Shit+V

No, that would be wrong. Unless the user inserts a link, no plain text should contain a link. Of course, rich texts will bring their probable links with themselves if pasted by using Ctrl+Shit+V — as its name says, it pastes HTML; it doesn't create HTML out of nothing.

I will also read the documentation again to clarify why a created link should be Italic

You started with "personal taste" and now talk about "should" ;) I could have made it bold too. Italic+underline was my choice.

ghost commented 2 years ago

Unless the user inserts a link

Markdown text can contain a link (from a Firefox extension for example) [GitHub](https://github.com/)

which will give [GitHub](https://github.com/) in Fnotes with Ctrl+V and Ctrl+Shift+V. And will give ksnip_20220520-101457 in other note tacking apps.

This is the background of my request. I clearly understand that Feathernotes is as it is, and fully accept it.

tsujan commented 2 years ago

Still, Paste HTML does its job correctly. Inserting a link when there's no HTML link in the clipboard would be a bug. If Markdown features were also present, an extra menu-item would be needed.

FeatherNotes is HTML-only. I had a hard time to find and circumvent annoying bugs/problem in QTextEdit. I might add markdown features when I'm ready to encounter more Qt issues and find workarounds for them.