mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-15 07:45:50 +02:00
Fix replacement of relative doc links
This commit is contained in:
parent
c0c75e16f4
commit
cfc6030d23
2 changed files with 16 additions and 1 deletions
lib/server
|
@ -190,10 +190,16 @@ function execute(port) {
|
|||
? "/" + metadata.version + "/"
|
||||
: "/"
|
||||
);
|
||||
// replace relative links without "./"
|
||||
rawContent = rawContent.replace(
|
||||
new RegExp("\\]\\(" + key, "g"),
|
||||
"](" + link
|
||||
);
|
||||
// replace relative links with "./"
|
||||
rawContent = rawContent.replace(
|
||||
new RegExp("\\]\\(\\./" + key, "g"),
|
||||
"](" + link
|
||||
);
|
||||
});
|
||||
|
||||
// replace any relative links to static assets to absolute links
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue