Commit 5856cb7c authored by Fred Chasen's avatar Fred Chasen

scope template lookup to data-ref=pagedjs-content

parent 66c1ae1b
......@@ -80,11 +80,12 @@ class Previewer {
// Check if a template exists
let template;
template = body.querySelector(":scope > template");
template = body.querySelector(":scope > template[data-ref='pagedjs-content']");
if (!template) {
// Otherwise create one
template = document.createElement("template");
template.dataset.ref = "pagedjs-content";
template.innerHTML = body.innerHTML;
body.innerHTML = "";
body.appendChild(template);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment