Clone template instead of modifying original

This commit is contained in:
2025-06-16 22:41:32 -07:00
parent ccd1d5eabc
commit 46a3a93a37
3 changed files with 12 additions and 27 deletions

View File

@@ -70,9 +70,6 @@ export async function build(svg, request) {
return acc;
}, {});
console.log('refs', refs);
console.log(counters.split('/').pop().split('-').shift());
const hashedFilenames = {
'counters.svg': counters,
'mapsheets.svg': mapsheets
@@ -98,13 +95,6 @@ export async function build(svg, request) {
});
});
// scenario.querySelectorAll('use.mapsheet').forEach(el =>
// gb.querySelector('#background').after(svg.ownerDocument.importNode(el, true))
//);
// startLocs.querySelectorAll('.counter').forEach(el => console.log(el));
//console.log(startLocs);
//if (startLocs) grid.before(svg.ownerDocument.importNode(startLocs, true));
const scenarioGrid = scenario.querySelector('.grid');
@@ -113,8 +103,6 @@ export async function build(svg, request) {
grid.replaceWith(svg.ownerDocument.importNode(scenarioGrid, true));
}
//defs.replaceWith(scenario.querySelector('defs'));
await loadScript(scenario, svg, 'radial')
return loadScript(scenario, svg, 'map');
}