-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Bug: Link to headings not working #202
Comments
Ah. I made sure to cover all relative paths in the application but hadn't considered that there might be relative paths in the content! I'll take a look to see if I can intercept the rendering of hyperlinks and use Vue Router to set the href value to an absolute path (which would take path prefixes into account). |
@pbogre - The develop branch now has a resolution for this. |
Thanks for looking into this! I'll check out the develop branch as soon as I can. |
Just tested it, can confirm it's working! Thanks again. |
Headings still have their id attribute applied correctly via the
customHTMLRenderer
frombaseOptions.js
, however linking to these headings is not as simple after the recent update introducing support for running flatnotes in a subpath.Before, I was able to link to a heading in the same document with this code:
However after the update this redirects me to
http://example.com:8080/#heading-name
, instead of the old funtionalhttp://example.com:8080/note/ExampleNote/#heading-name
. If I used instead something like:Then it would work correctly, but it's quite ugly and requires a lot of repetition. I also tried using WikiLinks like so:
But this redirects me to
http://example.com:8080/note/ExampleNote%23heading-name
.A fix could be to change the behavior of links when they start with a
#
character, so for instance[Link to Heading](#heading-name)
always prepends the note's path to the redirecting URL. Otherwise it could be convenient to stop converting characters into URL-compatible characters when using WikiLinks, like in the example above where#
becomes%23
. This could be seen as an extension of WikiLinks, allowing you to not only link to another note but also a specific section of that note.I'm not sure how these changes would fare with an application running on a subpath.
The text was updated successfully, but these errors were encountered: