Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed URLs serving index files (
index.md
,PITCHME.md
) in server mode.Problem
Write presentation files in directories like below:
serverRoot/files/index.md
: markdown file for MarpserverRoot/files/image.png
: image file, used in index.md as![](image.png)
And run marp-cli as server mode like
marp --server serverRoot/
.Then
http://localhost:8080/
shows files and directories inserverRoot
byserve-index
.In the above settings, a link on that page is
http://localhost:8080/files
.When access to that,
serverRoot/files/index.md
is converted and shown in a browser, butserverRoot/files/image.png
is not shown in the presentation because the presentation address is/files
and![](image.png)
is linked to/image.png
, not/files/image.png
.When access to
http://localhost:8080/files/
(with a trailing slash),serverRoot/files/image.png
is shown.For compatibility with other modes,
![](image.png)
should be linked to/files/image.png
, not/image.png
I think.Solution
To fix this, there are 2 solutions:
serve-index
page.In this PR, fixed the template file
src/server/index.pug
to add a trailing slash to the directory links.