Open wolframroesler opened 2 years ago
You are talking about the highlighting, not the actual link (when you ctrl+click on it), right?
Yes, I guess it would be better to exclude it in the highlighting. @Waqar144, your thoughts?
Both highlighting and link target are affected. For example, if I put the following into a note:
(https://en.wikipedia.org/wiki/QOwnNotes):
then QOwnNotes displays the closing parenthesis and colon in blue, and ctrl-clicking the hyperlink tries to open https://en.wikipedia.org/wiki/QOwnNotes):
.
Btw, GitHub is getting it right (https://en.wikipedia.org/wiki/QOwnNotes): The closing parenthesis and colon aren't part of the link.
I really don't know what the "rule" is for links that are not marked as links in Markdown... The safest way is always to use <https://en.wikipedia.org/wiki/QOwnNotes>:)
, you don't have any issues with that.
Hard to tell how to do it right. Parentheses are definitely legal in URLs (e. g., https://en.wikipedia.org/wiki/Notes_(album)), and note that GitHub identifies the first )
as part of the URL but not the second, like it's checking whether the matching (
is part of the URL or not. Let's try it out:
How about braces?
And brackets?
Oh. How about angle brackets:
Maybe https://www.ietf.org/rfc/rfc1738.txt has something to say about it? Or perhaps it's because in natural language URLs in parentheses happen more frequently than in braces or brackets.
Anyway, would be great if QOwnNotes could do the same. Wrapping URLs in < >
as a workaround doesn't seem very elegant to me since URLs usually work fine without them.
For the record, here's how QOwnNotes currently renders the above:
Known issue and I think already noted in one of the highlighting issues I created.
Question is whether it's worth it to fix this properly and handle all edge cases or not. Maybe there is regex out there that can handle it completely, don't know. Also there are about 6 or 7 different types of url formats that need to be handled, all of varying characteristics.
Sounds like a lot of hassle... 😅
Expected behaviour
When a markdown document contains a hyperlink in parentheses (like this: http://example.com), the closing parenthesis and anything after it should not be part of the hyperlink.
Actual behaviour
The closing parenthesis and a following comma or period are part of the hyperlink (for example, http://example.com).
Steps to reproduce
Put a hyperlink into parentheses (for example, http://example.com).
Relevant log output in the Log panel
Expand
``` [10:33:42] [status] Stored 1 note(s) to disk ```Information about the application, settings and environment
Expand
QOwnNotes Debug Information =========================== ## General Info **Current Date**: `Do. Apr. 7 10:33:48 2022` **Version**: `22.4.0` **Build date**: `Apr 4 2022` **Build number**: `960` **Platform**: `linux` **Operating System**: `Ubuntu 20.04.4 LTS` **Build architecture**: `x86_64` **Current architecture**: `x86_64` **Release**: `Launchpad PPA` **Qt Version (build)**: `5.12.8` **Qt Version (runtime)**: `5.12.8` **Portable mode**: `no` **Settings path / key**: `/home/wolfram/.config/PBE/QOwnNotes.conf` **Application database path**: `/home/wolfram/.local/share/PBE/QOwnNotes/QOwnNotes.sqlite` **Application arguments**: `QOwnNotes` **Qt Debug**: `0` **Locale (system)**: `en_GB` **Locale (interface)**: *empty* **Primary screen resolution**: `2560x1440` **Icon theme**: *empty* **Notes in current note folder**: `3` **Calendar items**: `0` **Enabled scripts**: `0` ## Server Info **serverUrl**: *empty* **appIsValid**: `no` **notesPathExists**: *empty* **connectionErrorMessage**: *empty* ## Spellchecking **Enabled**: `false` **Selected language**: `auto` **Language codes**: `de_AT, de_AT_frami, de_CH, de_CH_frami, de_DE, de_DE_frami, en_AU, en_CA, en_GB, en_US, en_ZA` **Language names**: `Österreichisches Deutsch (Österreich), Österreichisches Deutsch (Österreich), Schweizer Hochdeutsch (Schweiz), Schweizer Hochdeutsch (Schweiz), Deutsch (Deutschland), Deutsch (Deutschland), Australian English (Australia), Canadian English (Canada), British English (United Kingdom), American English (United States), English (South Africa)` **Application dictionaries path**: `/home/wolfram/.local/share/PBE/QOwnNotes/dicts` ## Note folders **currentNoteFolderId**: `2` ### Note folder `default` **id**: `2` **isCurrent**: `yes` **activeTagId**: `0` **localPath**: `/home/wolfram/SynologyDrive/Notes` **remotePath**: `Notes` **cloudConnectionId**: `1` **isShowSubfolders**: `no` **isUseGit**: `no` **allowDifferentNoteFileName**: `no` **activeNoteSubFolder name**: *empty* **database file**: `/home/wolfram/SynologyDrive/Notes/notes.sqlite` ## Cloud connections ### Cloud connection `Default` **id**: `1` **isCurrent**: `yes` **serverUrl**: *empty* **username**: *empty* **accountId**: *empty* ## Enabled scripts ## Settings **ActiveNoteHistoryItem** (NoteHistoryItem): `