Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render across
<template>
element boundaries
Take, for example, a `<template>` that nests other `<template>` elements: ```html <template> <template> <div>{{x}}</div> </template> </template> <script type="module"> import { TemplateInstance } from "@github/template-parts" const template = document.querySelector("template") const instance = new TemplateInstance(template, { x: "Hello world" }) document.body.append(instance) </script> ``` Prior to this change, the inner `<template>` element (and its child `<div>`) are unchanged and still render `{{x}}` as a text node. This change aims to bring support for templating across `<template>` boundaries. To achieve this behavior, add explicit [HTMLTemplateElement][] handling to the tree walking. When handling a `<template>` element, walk its content `DocumentFragment`, treating variables in the same as way as the outer `<template>` element. [HTMLTemplateElement]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLTemplateElement
- Loading branch information