feat(web): add ALLOW_INLINE_STYLES env var to opt-in inline CSS in Markdown rendering (#34719)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
s-kawamura-upgrade
2026-04-08 08:38:24 +00:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 546062d2cd
commit 0e0bb3582f
8 changed files with 25 additions and 1 deletions
+6
View File
@@ -19,6 +19,11 @@ const clientSchema = {
* Default is not allow to embed into iframe to prevent Clickjacking: https://owasp.org/www-community/attacks/Clickjacking
*/
NEXT_PUBLIC_ALLOW_EMBED: coercedBoolean.default(false),
/**
* Allow inline style attributes in Markdown rendering.
* Self-hosted opt-in for workflows using styled Jinja2 templates.
*/
NEXT_PUBLIC_ALLOW_INLINE_STYLES: coercedBoolean.default(false),
/**
* Allow rendering unsafe URLs which have "data:" scheme.
*/
@@ -153,6 +158,7 @@ export const env = createEnv({
client: clientSchema,
experimental__runtimeEnv: {
NEXT_PUBLIC_ALLOW_EMBED: isServer ? process.env.NEXT_PUBLIC_ALLOW_EMBED : getRuntimeEnvFromBody('allowEmbed'),
NEXT_PUBLIC_ALLOW_INLINE_STYLES: isServer ? process.env.NEXT_PUBLIC_ALLOW_INLINE_STYLES : getRuntimeEnvFromBody('allowInlineStyles'),
NEXT_PUBLIC_ALLOW_UNSAFE_DATA_SCHEME: isServer ? process.env.NEXT_PUBLIC_ALLOW_UNSAFE_DATA_SCHEME : getRuntimeEnvFromBody('allowUnsafeDataScheme'),
NEXT_PUBLIC_AMPLITUDE_API_KEY: isServer ? process.env.NEXT_PUBLIC_AMPLITUDE_API_KEY : getRuntimeEnvFromBody('amplitudeApiKey'),
NEXT_PUBLIC_API_PREFIX: isServer ? process.env.NEXT_PUBLIC_API_PREFIX : getRuntimeEnvFromBody('apiPrefix'),