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): allow spaces in href value regex #1030

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

juliesaia
Copy link
Contributor

πŸ”— Linked issue

#1029

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 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)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Removes the space character from the end group character set in LINK_REGEX. Only single/double quotes can end the match now, allowing for href paths with spaces in them.

Resolves #1029

πŸ“ Checklist

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

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. BTW space is not normally an allowed char (#1029 (comment))

@manniL
Copy link
Member

manniL commented Mar 7, 2023

Should we emit a warning in this case (and allow it)?

@codecov
Copy link

codecov bot commented Mar 7, 2023

Codecov Report

Merging #1030 (701dbb7) into main (b495675) will decrease coverage by 0.08%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1030      +/-   ##
==========================================
- Coverage   67.59%   67.51%   -0.08%     
==========================================
  Files          62       62              
  Lines        6259     6259              
  Branches      707      706       -1     
==========================================
- Hits         4231     4226       -5     
- Misses       2015     2019       +4     
- Partials       13       14       +1     
Impacted Files Coverage Ξ”
src/prerender.ts 89.34% <100.00%> (ΓΈ)
src/presets/cloudflare-pages.ts 85.26% <0.00%> (-1.06%) ⬇️
src/rollup/config.ts 87.55% <0.00%> (-0.88%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@pi0
Copy link
Member

pi0 commented Mar 7, 2023

Should we emit a warning in this case (and allow it)?

We might do it in higher order (prerenderer) with an opt-in validate feature. Seems browsers can handle it at least apart of the spec.

@pi0 pi0 changed the title fix: allow spaces in prerender href regex fix(prerender): allow spaces in href value regex Mar 7, 2023
@pi0 pi0 merged commit a322405 into unjs:main Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prerender crawler breaks for links with spaces
3 participants