Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make internal links more robust/interoperable #92

Closed
finn-matti opened this issue Nov 3, 2020 · 3 comments
Closed

Make internal links more robust/interoperable #92

finn-matti opened this issue Nov 3, 2020 · 3 comments

Comments

@finn-matti
Copy link

This issue is thought as an umbrella issue to think about how a more robust linking mechanism could look like.

At the moment the conversion of internal links is supposed to work like this:

  • If there is an internal link in the enml, then this gets converted to a WikiLink that links to the title of the note that is linked.

This is a good general approach however it has its problems:

  1. Titles that are too long, contain spaces or other symbols are not converted correctly
  2. Notes cannot contain certain symbols to work with certain Markdown apps (e. g. Obsidian):
    • These are (at least)* " \ / < > : |
  3. Not everybody is using WikiLinks:
    • It should be possible to use MarkdownLinks for internal Links as well.

Proposed solution

As far as I can see it, most importantly we need to make sure that the internal link === filename.

This means we need to normalize internal Links and filenames in the same way. I think we should write a function that - given a string (the title of the note) - returns a "safe" version of that string and it is used in the file creation as well as in the internal link creation steps.

Furthermore I think it should be possible for the user to decide if internal links should be in Markdown or Wiki format.

Finally, inside internal links the link should also contain the (unescaped) title of the note as the name of the link. E. g.:

[[nameOfFile|Display Name]]
[Display Name](nameOfFile)

Maybe the last part should be optional.

This solution would solve all the corner cases we are aware of right now and makes sure that there is only one place to add to/change if new cases come up: the normalizeTitle function.

Feedback and comments are appreciated!

@akosbalasko
Copy link
Owner

Hi @finn-matti !
So, if I see well, as we merged #94 , it solves this umbrella issue, and all the issues detailed in the description, #73 , #90, and #91 also, right?

@finn-matti
Copy link
Author

@akosbalasko I think so!

@akosbalasko
Copy link
Owner

@finn-matti , great, thanks for the confirmation, I close those issues also.

implemented in #94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants