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

Regular markdown links not working with spaces? #543

Open
aureusx opened this issue Jan 26, 2021 · 2 comments
Open

Regular markdown links not working with spaces? #543

aureusx opened this issue Jan 26, 2021 · 2 comments
Labels
bug Something isn't working case-for-tests
Milestone

Comments

@aureusx
Copy link

aureusx commented Jan 26, 2021

Hi!

First of all, thanks a lot for developing neuron srid, I just found out about it and I’m currently trying to implement it with my notes. I do use, however, as I come from Obsidian, spaces in my filenames, and then regular markdown links seem to break (wikilinks do not). Your documentation though seems to state to me that spaces should work.

I did some research within the documentation and the issues presented here, however I don’t really see me doing anything wrong, so it might be a bug?

So I’m basically including three different link versions in my index as follows:

# Index

[[Philosophischer Standpunkt]]
[Philosophischer Standpunkt](Philosophischer%20Standpunkt.md)
[Philosophischer Standpunkt](Philosophischer Standpunkt.md)

As I said, the first one works, the other ones do not. To add another slightly weird aspect (at least it’s to me): The second one does render as a link, pointing to the markdown, not html file though though.

As your documentation seems to state that spaces should be left as-is, I thought the third one should render. But that is treated as simple text it seems:

Bildschirmfoto 2021-01-26 um 18 04 32

I’m probably gonna change my filenames anyway, although that will make it slightly more challenging to use in Obsidian — but it will be the most compatible way to handle things in the future I guess. However, it seems to me there is either a bug in the code or in the documentation, so I thought I’d report. Hopefully I haven’t overlooked anything on my side.

I’m trying this out with a Docker container, as I plan on running it on a server full of Docker containers anyway, if that makes a difference. The web UI tells me I’m using Neuron 1.9.6.5. Oh and I don’t get your versioning yet, by the way. :) But as that’s just 0.0.0.1 below the version you’re using on the website, it should be up to date?

Keep up the great work!

srid added a commit that referenced this issue Jan 26, 2021
@srid srid added the bug Something isn't working label Jan 26, 2021
@srid
Copy link
Owner

srid commented Jan 26, 2021

Looks like a bug in LinkCache querying. The Map is populated with decoded URL, but the lookup happens on encoded URL.

renderHandleLink LinksData {..} url mInline = do
r <- Map.lookup url linksDataLinkCache
pure $ renderZettelLinkMay mInline r

I hate using Text used for both types of strings. We should use different types (Text.URI.URI for decoded URL), and add unit tests. When plugin support was added, a bunch of tests got removed; so they should be added back - but at plugin level.

@aureusx
Copy link
Author

aureusx commented Jan 26, 2021

Alright, at least I haven’t gotten anything completely wrong here then. Can’t really comment on the technical details though, as my experience with Haskell is totally zero (although I’m into functional programming with Clojure, haha).

I realized something else though — are the Folgezettel semantics with the # supposed to work with regular markdown links? That unfortunately only works for wikilinks it seems, so that might be something to look into as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working case-for-tests
Projects
None yet
Development

No branches or pull requests

2 participants