# Editability of html5 template tag's content?

**URL:** <https://discuss.prosemirror.net/t/editability-of-html5-template-tags-content/2542>\
**Category:** Uncategorized\
**Created:** [February 18, 2020, 2:54pm UTC](https://discuss.prosemirror.net/t/editability-of-html5-template-tags-content/2542 "2020-02-18T14:54:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kapouer](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/kapouer/32/227_2.png) [@kapouer](https://discuss.prosemirror.net/u/kapouer)\
**Post date:** [February 18, 2020, 2:54pm UTC](https://discuss.prosemirror.net/t/editability-of-html5-template-tags-content/2542/1 "2020-02-18T14:54:08Z")

</div>

I wonder if prosemirror could support edition of a template node:

```auto
<template>
<p>some block content</p>
</template>

```

- it is possible to template.append(template.content) and directly edit that content, as it would be possible with a standard div
- serialization from DOM to HTML behaves as expected
- parsing from html string in prosemirror always fail since the html fragment inside the template tag goes into template.content and template.childNodes is empty.

If prosemirror-view systematically did

```auto
if (template.content) {
  template.textContent = '';
  template.appendChild(template.content)
}

```

it would fix it. However i’m not sure of the side effects.

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [February 18, 2020, 3:47pm UTC](https://discuss.prosemirror.net/t/editability-of-html5-template-tags-content/2542/2 "2020-02-18T15:47:39Z")

</div>

Yeah, that seems dodgy, and I’m not really sure what the point is of editing literal `<template>` tags in the editor. Couldn’t you just wrap the content in a different tag and serialize it to a `<template>` in non-editable output?

---

<div class="post-metadata">

**Author:** ![kapouer](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/kapouer/32/227_2.png) [@kapouer](https://discuss.prosemirror.net/u/kapouer)\
**Post date:** [February 18, 2020, 4:24pm UTC](https://discuss.prosemirror.net/t/editability-of-html5-template-tags-content/2542/3 "2020-02-18T16:24:48Z")

</div>

I actually did that, but it felt a bit of a hack, and at some point i tried to just work directly with template tags, to see what happens, and the conclusion is that some approach could work. Maybe if more users have similar cases to share a systematic approach would make sense.
