Plugin cookbook
The templates plugin makes HTML fragments convenient; the sanitizer removes unsafe markup before insertion.
The sample contains a script tag. Because the gallery registers the sanitize plugin, the script is removed before the template is inserted.