From 19bce9aa942bf273d7b24d67aaa762e9803719db Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sat, 3 Oct 2026 16:27:58 +0000 Subject: [PATCH] check:side-lanes accepts the document print: a printed sheet goes to its own document before any raster (the photo guarantee holds), and its poison follows the new line --- .../country-posters/scripts/check-side-lanes.mjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugin-designs/country-posters/scripts/check-side-lanes.mjs b/plugin-designs/country-posters/scripts/check-side-lanes.mjs index b0a63a2e1..17cb811fa 100644 --- a/plugin-designs/country-posters/scripts/check-side-lanes.mjs +++ b/plugin-designs/country-posters/scripts/check-side-lanes.mjs @@ -107,7 +107,11 @@ async function photoArms(html, rasterSrc, wallSrc) { else if (ext(svg)) fails.push(`photos: rasterPoster would rasterise ${ext(svg)} external (each one prints the broken-image glyph)`) // (b) the wall's generated-sheet branch prints a sheet with external images as a document, before any raster const branch = (wallSrc.match(/if \(props\.sheet\) \{[\s\S]*?rasterPoster\(html/) || [''])[0] - if (!/posterAction === 'print' && hasExternalImages\(html\)\) \{ await printSheetDocument\(html\); return \}/.test(branch)) fails.push('photos: PosterWall prints a sheet with photos through the raster (they cannot draw there)') + // Either route keeps the guarantee: a PRINT of a sheet with photos never reaches the raster. Today every printed + // sheet goes to its own document first (the document print); before that, only a sheet with photos did. + const docFirst = /posterAction === 'print'\) \{ step\('print'\); await printSheetDocument\(html\); return \}/.test(branch) + || /posterAction === 'print' && hasExternalImages\(html\)\) \{ await printSheetDocument\(html\); return \}/.test(branch) + if (!docFirst) fails.push('photos: PosterWall prints a sheet with photos through the raster (they cannot draw there)') if (!/async function printSheetDocument\(html\)[\s\S]{0,400}printDocument\(html,/.test(wallSrc)) fails.push('photos: printSheetDocument does not hand the sheet itself to printDocument') return fails } @@ -152,7 +156,7 @@ if (selfTest) { const rs = readFileSync(RASTER, 'utf8'), ws = readFileSync(WALL, 'utf8') for (const [name, r, w, rx] of [ ['a raster that keeps external images', rs.replace('stripExternalImages(inlineSvg(posterHtml))', 'inlineSvg(posterHtml)'), ws, /rasterise \d+ external/], - ['a wall print that rasterises a sheet with photos', rs, ws.replace("if (props.posterAction === 'print' && hasExternalImages(html)) { await printSheetDocument(html); return }", ''), /through the raster/], + ['a wall print that rasterises a sheet with photos', rs, ws.replace("if (props.posterAction === 'print') { step('print'); await printSheetDocument(html); return }", ''), /through the raster/], ]) { if (r === rs && w === ws) { console.log(`NOT MEASURED: the poison anchor for "${name}" moved`); process.exitCode = 75; continue } const f = await photoArms(html, r, w)