Closed pbogre closed 4 months ago
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. [Link to Heading](#heading-name)
should now resolve as expected. I've pushed a build to Docker Hub, so please give the :develop
tag a go if you can.
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.