[FEATURE] Ways to improve compatibility with other markdown editors #3225
Labels
Effort: Tremendous
Severity: Low
Bugs or breaking changes with low impact
Type: Breaking change
Fix or feature that will cause existing functionality to change
Type: Feature
adds functionality
Compatibility between QOwnNotes and other Markdowneditors
Motivation
Markdown editors differ when it comes syntax notations for markdown links. Advanced features like updating links upon file/folder renaming depend on the specific markdown syntax for a particular programme. Also simple things like referencing headings show different syntaxes and therefore will sometimes not be updated on renaming due to a deviating notation. Overall, this causes links to break.
An idea is to provide a way to import markdown files, adapt the "standard" markdown links and fix deviating syntaxes, so one can easily work in multiple Markdowneditors at the same time or swap between editors easily. I am thinking of writing a script for that purpose, but maybe it is more useful to change the programme code in order to deal with differnt syntaxes.
Note, I understand that not every exotic syntax needs to be implemented that is actually allowed by e.g. commonmark, therefore translating foreign syntax into readable one seems the easier choice.
There are two sides of the coin:
A) Importing files from some random editorintoQownNotes: Random Editor ↦ QOwnNotes
B) Exporting files from QOwnNotes to some random editor : Random Editor ↤ QOwnNotes
Most significant incompatibility types
There are 5 major incompatibility issues:
[Link][URLENCODEDlinkpath]
Different handling of URL encoding of characters in links + different handling of special characters within them.↦ Some programmes make exceptions for "German Umlaute" oder accents or greek Symbols etc. and show them unencoded in the link path for readability purposes.
↤ QOwnNotes strictly URL encodes links - other programmes leave Ö, Ü, Ä, Ø, etc. as is. Other programmes might not know what to do with QOowNotes links:
[Ü 3 - H 2 in Ü 3](F2/F3/%C3%9C%203.md#H%202%20in%20%C3%9C%203)
[Link][URLENCODEDLinks#with-heading or with%20Heading?]
Different heading syntax:#with-heading
orwith%20Heading
? Lowercase letters and-
delimiter vs. URL encoding (e.g.%20
) and leaving capital letters.Additionally should special characters be URLencoded? (see. 1)
[Link][./with%20dot%20and%20slash]
: relative links with leading./
producded by VS Codium to emphasise the relative nature of links compared to absolute links:[Link][/folder/with%20and%20slash]
. Those links should ideally be supported by QN in the future as they are quite common amonst editors.[Link][<Angle Bracket links>]
(supported by commonmark): Renaming or moving files/folders in VSCodium creates these. QN does not support them fully (especially when moving files and updating links).[Link][<Angle%20Bracket%20links%20with%20spaces%20replaced%20by%20>]
: Subcase of 4. just with URL encoding or not.Current Solutions
Possible Script implementation (ordered by importance)
Import to QN
[](<name.md>)
to[](name.md)
and[](<name with space.md>)
to[](name%20with %20space.md)
[text](./link.md)
⇒[](link.md)
(QN does not update these links on file move. This should probably be added)[](Ö.md)
to[](%C3%9C.md>)
Export from QN
[](%C3%9C.md>)
to[](Ö.md)
especially in links with headings.Open Questions and to-dos
escape()
will not encode:@*/
encodeURI()
will not encode:~!@#$&*()=:/,;?+'
encodeURIComponent()
will not encode:~!*()'
Possible Problems and Dangers
Folderwide replacement might lead to false positives. Work thoroughly and with great care! Write a note to back up the files first.
Checked Programmes that are similar to QOwnNotes
./ and
../` in front of links)Overview over supported features (subject to change with new versions)
u.o.f.m./r. = update on file move/rename
[Text](ÖÜÄà.md)
[Text](ÖÜÄà.md)
[Text](<ÖÜÄà.md>
)[Text](%D6%DC%C4%E0.md)
[Text](file.md#With%20%DCberschrift)
[Text](file.md#with-überschrift)
[Link](<Link with Spaces.md>)
clickable[Link](<Link with Spaces.md>)
[Link](<Link%20with%20Spacesencoded.md>)
[Link](<Link%20with%20Spacesencoded.md>)
./
clickable./
u.o.f.m./r.The text was updated successfully, but these errors were encountered: