-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug with new version of purell #878
Comments
There's another fix in this branch that I just merged, it fixes a bug with Go's stdlib parser that unnecessarily encodes some reserved URL characters (see PuerkitoBio/purell#7 and golang/go#5684). I doubt this one should cause issues to hugo, but anyway it is included in this branch. |
Thank you @PuerkitoBio for the heads up! For reference, here is more background information: PuerkitoBio/purell#5 The When Hugo (latest HEAD) is built with
and
More investigation is needed. To be continued... ;-) |
Looking at the test, the new results seem OK, the input is So I think the new test results are correct. Keep in mind that I don't know the viper package, though, this is just an impression by looking at the test itself. |
@PuerkitoBio, I would agree that the Purell's new behaviour is more correct. However, it is not just the test cases in Hugo that would fail—we do not want to break any existing Hugo sites either, as the use of I am still pretty new to Hugo (and to Go) myself, so it is taking me a bit of time to study the relevant Hugo code as well as testing a few Hugo generated web sites and see how things may break. Besides, there is now a new test error A quick I do think that it would be the best interest for both projects that this change is dealt with soon. Hugo v0.13's release is imminent (likely within a few days), and so is Purell's fix of relative paths, so it is better for Hugo to adapt to Purell's new behaviour before the v0.13 release, otherwise anyone who tries to compile Hugo v0.13 would have a buggy @PuerkitoBio, please allow us one or two more days for us to find a solution, and once we have a fix for Hugo ready, you may then merged Thanks again for your patience, and thanks to your wonderful |
Oh sure, no problem, AFAIK hugo is the most popular user of purell, no point in rushing in a change that would break it. The sooner the better, obviously, since it fixes bugs, but let me know when you're ok with the merge. |
Temporary workaround for the bug fix and resulting behavioral change in purell.NormalizeURLString(): a leading '/' was inadvertently to relative links, but no longer, see gohugoio#878. I think the real solution is to allow Hugo to make relative URL with relative path, e.g. "../../post/hello-again/", as wished by users in issues #157, #622, etc., without forcing relative URLs to begin with '/'. Once the fixes are in, let's remove this kludge and restore SanitizeUrl() to the way it was. Fixes gohugoio#878
@spf13: Thank you for merging #902! @PuerkitoBio: Hugo is now ready for the |
Thanks @anthonyfok, this is merged. Let me know if you have any issues. |
Temporary workaround for the bug fix and resulting behavioral change in purell.NormalizeURLString(): a leading '/' was inadvertently to relative links, but no longer, see gohugoio#878. I think the real solution is to allow Hugo to make relative URL with relative path, e.g. "../../post/hello-again/", as wished by users in issues gohugoio#157, gohugoio#622, etc., without forcing relative URLs to begin with '/'. Once the fixes are in, let's remove this kludge and restore SanitizeUrl() to the way it was. Fixes gohugoio#878
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi,
I'm the author of the
purell
package used by hugo (https://github.com/PuerkitoBio/purell). There's a fix for a bug with relative paths in purell that apparently causes issues for hugo, so I thought I'd give you a chance to look at it before I merge it into master. The fix is in thefix-relative-paths
branch.To give an idea, this test currently fails in master:
foo/bar
with flagFlagsAllGreedy
does not returnfoo/bar
, but/foo/bar
(rooted path)The changes in the fix-relative-paths branch fix this case, but it came to my attention via @anthonyfok that this broke the hugo tests. It is possible that hugo somehow relies on the buggy behaviour of purell.
If you could run a few tests with the
fix-relative-paths
branch and confirm to me when all is good, we can synchronize the merge to master and reduce the chance of breaking stuff in the wild.Thanks,
Martin
The text was updated successfully, but these errors were encountered: