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(prerender): decode html entities in rendered links #1824

Merged
merged 7 commits into from
Oct 18, 2023
Merged

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Oct 14, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I'm still investigating whether there's also something to be fixed in nuxt or vue-router, but it seems Vue router can in some circumstances render & for & within hrefs, and Nitro (by passing this literally rather than as the browser interprets it) can trigger infinite loops of prerendering, generating links like /enterprise/agencies?region=europe&service=ecommerce&service=ecommerce&service=content-marketing.

Example: https://stackblitz.com/edit/github-6rieuk?file=pages/index.vue (run npm run generate)

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added the bug Something isn't working label Oct 14, 2023
@danielroe danielroe requested a review from pi0 October 14, 2023 10:13
@danielroe danielroe self-assigned this Oct 14, 2023
src/prerender.ts Fixed Show fixed Hide fixed
@codecov
Copy link

codecov bot commented Oct 14, 2023

Codecov Report

Merging #1824 (94c305a) into main (d391b29) will increase coverage by 0.17%.
Report is 3 commits behind head on main.
The diff coverage is 100.00%.

❗ Current head 94c305a differs from pull request most recent head 67039f7. Consider uploading reports for the commit 67039f7 to get more accurate results

@@            Coverage Diff             @@
##             main    #1824      +/-   ##
==========================================
+ Coverage   52.24%   52.41%   +0.17%     
==========================================
  Files         170      170              
  Lines       11754    11759       +5     
  Branches      900      906       +6     
==========================================
+ Hits         6141     6164      +23     
+ Misses       5516     5499      -17     
+ Partials       97       96       -1     
Files Coverage Ξ”
src/prerender.ts 86.57% <100.00%> (+0.46%) ⬆️

... and 3 files with indirect coverage changes

src/prerender.ts Outdated Show resolved Hide resolved
@pi0
Copy link
Member

pi0 commented Oct 16, 2023

Thanks! Do you mind to add an example link in test fixtures as well? (we have a list of both valid + invalid examples in prerender route)

@pi0 pi0 merged commit 805eb7f into main Oct 18, 2023
6 of 7 checks passed
@pi0 pi0 deleted the fix/entities branch October 18, 2023 15:38
@pi0 pi0 mentioned this pull request Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants