From df0056accebb67d5e08d5fcf189d03c3c82061a9 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Mon, 8 Dec 2025 13:46:23 +0800 Subject: [PATCH] Fix possible grammatical errors injected --- bin/utils/combine.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/utils/combine.ts b/bin/utils/combine.ts index 8b5c7c0..5f85ba0 100644 --- a/bin/utils/combine.ts +++ b/bin/utils/combine.ts @@ -2,15 +2,17 @@ import fs from 'fs'; export default async function combineFiles(files: string[], output: string) { const contents = files.map((file) => { - const fileContent = fs.readFileSync(file); if (file.endsWith('.css')) { - return ( - "window.addEventListener('DOMContentLoaded', (_event) => { const css = `" + - fileContent + - "`; const style = document.createElement('style'); style.innerHTML = css; document.head.appendChild(style); });" - ); + const fileContent = fs.readFileSync(file, 'utf-8'); + return `window.addEventListener('DOMContentLoaded', (_event) => { + const css = ${JSON.stringify(fileContent)}; + const style = document.createElement('style'); + style.innerHTML = css; + document.head.appendChild(style); + });`; } + const fileContent = fs.readFileSync(file); return ( "window.addEventListener('DOMContentLoaded', (_event) => { " + fileContent +