#1820·PrivateBin

Use the template HTML element instead of our custom template logic

Author: rugkCreated Mar 29, 2026Updated Jun 4, 2026
Labelscode qualitybreaking changejavascript

Currently

We currently use the following HTML templates: https://github.com/PrivateBin/PrivateBin/blob/df5f4b1440f4386f79fba04f40444d496bd32bad/tpl/bootstrap5.php#L530-L554

Suggested

We should use the proper <template> HTML tag and the corresponding JavaScript logic.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/template

Implications

This would obviously be a breaking change for our template logic.

Details

Care needs to be taken for the event listeners, that they are either cloned or properly re-bound: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/template#data_on_the_documentfragment_is_not_cloned

Noticed this while doing/in PR #1797