-
Notifications
You must be signed in to change notification settings - Fork 400
Open
Labels
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
Only some links get crawled and prerendered
Expected behavior 🤔
All available links on pages should get crawled and prerendered
Steps to reproduce 🕹
Steps:
Context 🔦
Happens because Nitro's html parser (https://github.com/natemoo-re/ultrahtml) doesn't handle un-quoted attributes properly (natemoo-re/ultrahtml#82). Workaround we'll implement is to detect prerendering and requote the data-hk
attributes.
if (event.request.headers.get("x-nitro-prerender")) {
const _html = await stream;
const html = _html.replaceAll(/data-hk=(\d+)(?=\s|>)/g, 'data-hk="$1"');
return html
}