Commit c792b6e
committed
fix(core): DSD injection regex now handles slashes inside attribute values
Bug: <auth-forms then=\"/dashboard\"> rendered as an EMPTY custom element
with no shadow root — the sign-in and sign-up pages appeared blank.
Root cause: the DSD-injection regex in render-server.js used
`[^>/]*` to bound the attribute section, which stopped matching the
instant it saw \`/\` inside an attribute value. The whole opening tag
then failed to match the pattern, so injectDSD silently skipped the
tag and the server sent the bare \`<auth-forms>\` (which has no
light-DOM content) to the browser.
Fix: attribute section is now \`(?:\"[^\"]*\"|'[^']*'|[^>])*?\` —
quoted values are matched as a single unit (so slashes inside them
are fine), anything-but-\`>\` outside quotes. Non-greedy so
self-closing \`/>\` still lands in the selfClose capture group.
+ 1 regression test: component whose attr value is a URL path renders
with DSD (without the fix, this test would show DSD absent).
Verified end-to-end: /login now renders the tabbed login/signup form
server-side.1 parent a4d5c8c commit c792b6e
2 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
223 | 227 | | |
224 | | - | |
| 228 | + | |
225 | 229 | | |
226 | 230 | | |
227 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
| |||
0 commit comments