So when using pathPrefix, relativeUrls inside html don't get prefixed. This doesn't make much sense, since I might want to create content in WordPress with relative URLs that don't use the prefix yet, so later I can change the prefix to whatever I want.
Where this comes in handy and was really necessary, is a multisite setup with multiple translations.
What this fix does: When pathPrefix is used and the pluginOption.prefixRelativeUrls is active, the nodeStrings will be searched for elements, that start with href= and include a url that starts with /.
Excluded by the regex are urls that start with: pathPrefix|/wp-content|/wp-admin|/wp-includes|//
So we don't want prefix already prefixed URLs or URLs that start with a double //.
Issue: #310
So when using pathPrefix, relativeUrls inside html don't get prefixed. This doesn't make much sense, since I might want to create content in WordPress with relative URLs that don't use the prefix yet, so later I can change the prefix to whatever I want.
Where this comes in handy and was really necessary, is a multisite setup with multiple translations.
What this fix does: When pathPrefix is used and the
pluginOption.prefixRelativeUrls
is active, the nodeStrings will be searched for elements, that start withhref=
and include a url that starts with/
.Excluded by the regex are urls that start with:
pathPrefix|/wp-content|/wp-admin|/wp-includes|//
So we don't want prefix already prefixed URLs or URLs that start with a double
//
.The other branch that was branched from v1.7.9 can be found here since I need a v1.7.10: https://github.com/henrikwirth/gatsby-source-wordpress-experimental/tree/fix-relative-urls-in-html