### Bug description

I want to make use of the HTML [`<template />` tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template) to allow me to create DOM elements which I can then reuse via JavaScript.

I am quarto feature [include-after-body](https://quarto.org/docs/output-formats/html-basics.html#includes) to insert the HTML.

When I try to read or clone the template, I only get `#document-fragment` without the stuff inside my `<template />` declaration. when I view source on the HTML output from Quarto, it seems that the `<template />` tag itself is still present, but in the source code its an empty tag.


For example, if I define a template like 

```html
<template id="productrow">
  <tr>
    <td class="record"></td>
    <td></td>
  </tr>
</template>
```

When I go to view source on the quarto output html file, I only see:
```
<template id="productrow"></template>
````

The tag has been emptied of is children elements somewhere in the rendering process it seems (?)

I am exporting to a revealjs presentation if that makes a difference, but I couldn't find anything about revealjs and `<template />` issues.


Here is a very small `*.qmd` that shows the same issue:
```
---
format: 
  revealjs:
    hash: true
    self-contained: false
---

## Some Slide


<table id="producttable">
  <thead>
    <tr>
      <td>UPC_Code</td>
      <td>Product_Name</td>
    </tr>
  </thead>
  <tbody>
    <!-- existing data could optionally be included here -->
  </tbody>
</table>

<template id="productrow">
  <tr>
    <td class="record"></td>
    <td></td>
  </tr>
</template>
```

When you render (I am rendering using the button in the VSCode plugin on Windows) and then vie source you will see:
```
...
</tbody>

</table>
<template id="productrow"></template><p></p>
<div class="footer footer-default">
...
```


### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
2023-01-05T19:39:22Z
erichgoldman
bug needs-repro
closed
Content of HTML <template /> tag is stripped
https://github.com/quarto-dev/quarto-cli/issues/3864