Closed pehaa closed 5 years ago
Hi! Thank you for taking time and doing a PR. Let me review it and I'll get back to you.
Great, thanks for catching this. Just a small correction. I don't like long regexes because time is needed to understand them when seen in the code. That's why I used URIParser
to make all url manipulations easier to read. What if instead of using a regex to get the subdirectory we get path()
from the WordPress url and then replace that path with /
in the link url. Does it make sense? Should be much fewer lines of code.
Hi! Huge thanks you for this plugin! There is a problem if WordPress is installed in a subdirectory (for example https://mydomain.com/subdirectory). In that case the internal links are not parsed correctly to gatsby Links. What happens is that https://mydomain.com/subdirectory/page1 becomes /subdirectory/page1 and not /page1
The
subdirectoryCorrection
function should fix it.