Fix malformed style boundary and guard HTML integrity

* chore: add one-time index html repair script

* chore: run one-time html repair on fix branch

* fix: close mobile style block [html-repair]

* chore: remove one-time html repair workflow

* chore: remove one-time html repair script

* test: add html style integrity checks

* test: enforce html integrity in deploy checks

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
pavlov346346-source 2026-09-11 07:41:42 +03:00 committed by GitHub
parent 6b8a1a604e
commit 5e38bf867b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 2 deletions

View File

@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"check:syntax": "node --check public/app-runtime.js && node --check public/service-worker.js && node --check public/legacy/bootstrap.js && node --check public/core/sun-safe.js && node --check public/core/performance.js && node --check public/core/auth-security-v1774.js && node --check public/core/data-layer-v1773.js && node --check public/core/server-automation-v1770.js && node --check public/core/hotfix-v1763.js && node --check public/core/ops-ux-v1762.js && node --check public/core/ux-fixes-v1764.js && node --check public/core/pdf-engine.js && node --check public/core/classic-offer-pdf-v1767.js && node --check public/core/developer-console-v1768.js && node --check public/core/offer-workspace-v1769.js",
"test:static": "node tests/static-security.mjs && node tests/auth-security-v1774.mjs && node tests/employee-create-v1774.mjs",
"test:static": "node tests/static-security.mjs && node tests/auth-security-v1774.mjs && node tests/employee-create-v1774.mjs && node tests/html-integrity-v1774.mjs",
"check:release": "node tests/release-check.mjs",
"check:deploy": "npm run check:syntax && npm run test:static && npm run check:release",
"test:e2e": "playwright test --config=tests/playwright.config.mjs",

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,11 @@
import fs from 'node:fs';
const html=fs.readFileSync('public/index.html','utf8');
let bad=0;
const check=(value,message)=>{console.log(`${value?'OK':'FAIL'}: ${message}`);if(!value)bad++};
const opens=(html.match(/<style(?:\s|>)/gi)||[]).length;
const closes=(html.match(/<\/style>/gi)||[]).length;
check(opens===closes,`style tags balanced (${opens} open / ${closes} close)`);
check(!html.includes('}<style id="sun-composition-v1757">'),'mobile style is not nested into composition style');
check(html.includes('}</style><style id="sun-composition-v1757">'),'mobile style closes before composition style');
check(/<\/style>\s*<\/head>/i.test(html),'last head style is closed before </head>');
if(bad)process.exit(1);