dundalek / markmap

Visualize markdown documents as mindmaps
MIT License
1.7k stars 175 forks source link

Links with headers/anchors break #28

Open JestDotty opened 5 years ago

JestDotty commented 5 years ago

home.md

# Root

[a link](file/somwhere.md)

file/somwhere.md

# somewhere
- over the rainbow
# elsewhere
- idk

works nicely

but if you try this it doesn't... home.md

# Root

[a link](file/somwhere.md#elsewhere)

It tries to make a file named somwhere.md#elsewhere when clicked

Similarly, [a link](#elsewhere) tries to make a file called #elsewhere.


I am using this in the atom extension but I think it probably has to do with this project missing the feature.

dundalek commented 5 years ago

Thanks for the report, that makes sense.

We can probably strip out the part after hash in the case of [a link](file/somwhere.md#elsewhere). But where would you expect the link to point out in the case of [a link](#elsewhere)?

JestDotty commented 5 years ago

To be honest I'm kind of wondering if it could read the file but start at the anchor in both cases. But it's ultimately up to you, I just noticed it behaves oddly.

(Also there could be an argument made of having arrows point to another existing node but probably is complex)

On Sun, Mar 31, 2019, 9:17 AM Jakub Dundalek, notifications@github.com wrote:

Thanks for the report, that makes sense.

We can probably strip out the part after hash in the case of a link. But where would you expect the link to point out in the case of a link?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dundalek/markmap/issues/28#issuecomment-478341054, or mute the thread https://github.com/notifications/unsubscribe-auth/AEgscPoAbRjl5LwypAaNmH34Yr_tZlA_ks5vcLVMgaJpZM4cTKJ9 .

dundalek commented 5 years ago

Having anchor to another specific node might be cool. However, probably more effort than I have time to put in. I will see what can be done when I find some time.