Skip to content

Commit

Permalink
fix(nuxt): fix replace regex used for slots in islands SSR (#24255)
Browse files Browse the repository at this point in the history
  • Loading branch information
huang-julien authored and manniL committed Dec 11, 2023
1 parent 5ac671e commit a797b3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nuxt/src/core/runtime/nitro/renderer.ts
Expand Up @@ -584,7 +584,7 @@ function replaceServerOnlyComponentsSlots (ssrContext: NuxtSSRContext, html: str
if (!match) { continue }
const [, uid, slot] = match
if (!uid || !slot) { continue }
html = html.replace(new RegExp(`<div nuxt-ssr-component-uid="${uid}"[^>]*>((?!nuxt-ssr-slot-name="${slot}"|nuxt-ssr-component-uid)[\\s\\S])*<div [^>]*nuxt-ssr-slot-name="${slot}"[^>]*>`), (full) => {
html = html.replace(new RegExp(`<div [^>]*nuxt-ssr-component-uid="${uid}"[^>]*>((?!nuxt-ssr-slot-name="${slot}"|nuxt-ssr-component-uid)[\\s\\S])*<div [^>]*nuxt-ssr-slot-name="${slot}"[^>]*>`), (full) => {
return full + teleports[key]
})
}
Expand Down

0 comments on commit a797b3c

Please sign in to comment.