Skip to content
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

fix: url containing dots were not correctly normalized with .html extension #934

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

sumy7
Copy link
Contributor

@sumy7 sumy7 commented Apr 10, 2024

Summary

This PR fixes an issue where URLs containing dots were not correctly appended with the .html extension.

/guide/version-0.1
expect:
/guide/version-0.1.html
actual:
/guide/version-0.1

Related Issue

#933

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link

netlify bot commented Apr 10, 2024

Deploy Preview for aquamarine-blini-95325f ready!

Name Link
🔨 Latest commit 62e9a38
🔍 Latest deploy log https://app.netlify.com/sites/aquamarine-blini-95325f/deploys/661735cec0689c0008b366da
😎 Deploy Preview https://deploy-preview-934--aquamarine-blini-95325f.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 88 (🔴 down 4 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@chenjiahan chenjiahan requested a review from Timeless0911 April 11, 2024 07:01
@Timeless0911
Copy link
Contributor

Timeless0911 commented Apr 11, 2024

if there exists a url like /foo/bar.png, it will be added a .html in current logic? I'm not sure if there is such a scenario, may be we need to know what is the original extension judgment logic for?

@sanyuan0704 any context about this logic?

@sumy7
Copy link
Contributor Author

sumy7 commented Apr 11, 2024

if there exists a url like /foo/bar.png, it will be added a .html in current logic? I'm not sure if there is such a scenario, may be we need to know what is the original extension judgment logic for?

@sanyuan0704 any context about this logic?

you are right. We should check all the usages of this function. Or add a flag to control this action.

@sumy7 sumy7 marked this pull request as draft April 11, 2024 07:46
@sumy7
Copy link
Contributor Author

sumy7 commented Apr 16, 2024

I have reviewed all the places where the function normalizeHref is used. It appears to be used only for organizing href parameters or handling article links, and there is no case where it handles such as .png suffixes. I will reopen this PR for now, but further confirmation is needed from @sanyuan0704 .

@sumy7 sumy7 marked this pull request as ready for review April 16, 2024 14:07
@sanyuan0704 sanyuan0704 merged commit df98cc9 into web-infra-dev:main Apr 17, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants