${escape(title)}
${getScript("viewer.js")}
`;
};
/**
* Escapes `<` characters in JSON to safely use it in ``;
}
return `
`;
}
function getAssetContent(filename: string) {
const assetPath = path.join(assetsRoot, filename);
if (!assetPath.startsWith(assetsRoot)) {
throw new Error(`"${filename}" is outside of the assets root`);
}
return fs.readFileSync(assetPath, "utf8");
}