Skip to content

Commit 6a9464a

Browse files
committed
Emit the scroll-region script inside the document
The page-level script was placed after </LegalLayout>, and anything after the layout close renders after </html> — the validator flags it as a stray start tag, exactly like the page's pre-existing anchor-js tags. Moved inside the layout slot, where hoisted scripts emit inside <body>.
1 parent 9a9662d commit 6a9464a

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/pages/ce-vs-pe-diff/index.astro

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,13 @@ import LegalLayout from '../../layouts/LegalLayout.astro';
278278
</div>
279279

280280
</div>
281+
282+
{/* Inside the layout: content placed after </LegalLayout> is emitted after
283+
</html>, as the anchor-js tags below already are. */}
284+
<script>
285+
import { initScrollRegionTabindex } from '@util/scroll-region-tabindex';
286+
initScrollRegionTabindex();
287+
</script>
281288
</LegalLayout>
282289

283290
<script
@@ -287,11 +294,6 @@ import LegalLayout from '../../layouts/LegalLayout.astro';
287294
crossorigin="anonymous"></script>
288295
<script is:inline>anchors.add();</script>
289296

290-
<script>
291-
import { initScrollRegionTabindex } from '@util/scroll-region-tabindex';
292-
initScrollRegionTabindex();
293-
</script>
294-
295297
<style lang="scss">
296298
@use '../../styles/_variables.scss' as v;
297299

0 commit comments

Comments
 (0)