markbind
markbind copied to clipboard
Panel's pop-up attribute URL calculation is wrong when being included
Tell us about your environment
- MarkBind Version: 1.8.2
What did you do?
- Given a file,
A.md
that has a Panel with a local URL specified in thepop-up
attribute to a fileB.md
. - Given another file
C.md
in another directory. - If file
C
<includes>
fileA
, the URL calculation for the local URL of fileB.md
will be using fileC
's directory as a base, which will result in a invalid directory being accessed.
What did you expect to happen?
Panel in file A
continue using file A
's directory for local URL calculation, even after being included in file C
.
Reproduced in #277 user guide migration, in the pop-up
attribute section in components#panels
Code: mainPage.md
<include src="docs/index.html" />
docs/index.md
<panel popup-url="loadContent.html">
...
</panel>
docs/loadContent.md
File content does not matter.
Expected:
The popup that is rendered in mainPage.html
should link to docs/loadContent.html
.
Actual:
The popup links to loadContent.html
instead.
Using {{ baseUrl }}
would avoid this problem, right?
<panel popup-url="{{ baseUrl }}/docs/loadContent.html">
Using
{{ baseUrl }}
would avoid this problem, right?
<panel popup-url="{{ baseUrl }}/docs/loadContent.html">
It does, although the main concern is that the problem (and hence the solution) is not immediately obvious to the author.
It does, although the main concern is that the problem (and hence the solution) is not immediately obvious to the author.
ATM, that is the behavior for any link, not just popup-URL. I came across it here. Yes, we should document it as it is a basic feature.