Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
feat: add env NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX (#27070)
wangxiaoleice5fe864305d
diff --git a/docker/.env.example b/docker/.env.exampleindex 4b9cdc526e3..e47bea2ff92 100644--- a/docker/.env.example+++ b/docker/.env.example@@ -201,6 +201,10 @@ ENABLE_WEBSITE_JINAREADER=trueENABLE_WEBSITE_FIRECRAWL=trueENABLE_WEBSITE_WATERCRAWL=true+# Enable inline LaTeX rendering with single dollar signs ($...$) in the web frontend+# Default is false for security reasons to prevent conflicts with regular text+NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX=false+# ------------------------------# Database Configuration# The database uses PostgreSQL. Please use the public schema.diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yamlindex a18138509c6..606d5ec58f4 100644--- a/docker/docker-compose.yaml+++ b/docker/docker-compose.yaml@@ -51,6 +51,7 @@ x-shared-env: &shared-api-worker-envENABLE_WEBSITE_JINAREADER: ${ENABLE_WEBSITE_JINAREADER:-true}ENABLE_WEBSITE_FIRECRAWL: ${ENABLE_WEBSITE_FIRECRAWL:-true}ENABLE_WEBSITE_WATERCRAWL: ${ENABLE_WEBSITE_WATERCRAWL:-true}+ NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX: ${NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX:-false}DB_USERNAME: ${DB_USERNAME:-postgres}DB_PASSWORD: ${DB_PASSWORD:-difyai123456}DB_HOST: ${DB_HOST:-db}diff --git a/web/.env.example b/web/.env.exampleindex 23b72b3414c..4c5c8641e07 100644--- a/web/.env.example+++ b/web/.env.example@@ -61,5 +61,9 @@ NEXT_PUBLIC_ENABLE_WEBSITE_JINAREADER=trueNEXT_PUBLIC_ENABLE_WEBSITE_FIRECRAWL=trueNEXT_PUBLIC_ENABLE_WEBSITE_WATERCRAWL=true+# Enable inline LaTeX rendering with single dollar signs ($...$)+# Default is false for security reasons to prevent conflicts with regular text+NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX=false+# The maximum number of tree node depth for workflowNEXT_PUBLIC_MAX_TREE_DEPTH=50diff --git a/web/app/components/base/markdown/react-markdown-wrapper.tsx b/web/app/components/base/markdown/react-markdown-wrapper.tsxindex 054b5f66cba..afe3d8a7371 100644--- a/web/app/components/base/markdown/react-markdown-wrapper.tsx+++ b/web/app/components/base/markdown/react-markdown-wrapper.tsx@@ -4,6 +4,7 @@ import RemarkBreaks from 'remark-breaks'import RehypeKatex from 'rehype-katex'import RemarkGfm from 'remark-gfm'import RehypeRaw from 'rehype-raw'+import { ENABLE_SINGLE_DOLLAR_LATEX } from '@/config'import AudioBlock from '@/app/components/base/markdown-blocks/audio-block'import Img from '@/app/components/base/markdown-blocks/img'import Link from '@/app/components/base/markdown-blocks/link'@@ -34,7 +35,7 @@ export const ReactMarkdownWrapper: FC<ReactMarkdownWrapperProps> = (props) => {<ReactMarkdownremarkPlugins={[RemarkGfm,- [RemarkMath, { singleDollarTextMath: false }],+ [RemarkMath, { singleDollarTextMath: ENABLE_SINGLE_DOLLAR_LATEX }],RemarkBreaks,]}rehypePlugins={[diff --git a/web/app/layout.tsx b/web/app/layout.tsxindex 1be802460b3..c83ea7fd853 100644--- a/web/app/layout.tsx+++ b/web/app/layout.tsx@@ -57,6 +57,7 @@ const LocaleLayout = async ({[DatasetAttr.DATA_PUBLIC_ENABLE_WEBSITE_JINAREADER]: process.env.NEXT_PUBLIC_ENABLE_WEBSITE_JINAREADER,[DatasetAttr.DATA_PUBLIC_ENABLE_WEBSITE_FIRECRAWL]: process.env.NEXT_PUBLIC_ENABLE_WEBSITE_FIRECRAWL,[DatasetAttr.DATA_PUBLIC_ENABLE_WEBSITE_WATERCRAWL]: process.env.NEXT_PUBLIC_ENABLE_WEBSITE_WATERCRAWL,+ [DatasetAttr.DATA_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX]: process.env.NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX,[DatasetAttr.NEXT_PUBLIC_ZENDESK_WIDGET_KEY]: process.env.NEXT_PUBLIC_ZENDESK_WIDGET_KEY,[DatasetAttr.NEXT_PUBLIC_ZENDESK_FIELD_ID_ENVIRONMENT]: process.env.NEXT_PUBLIC_ZENDESK_FIELD_ID_ENVIRONMENT,[DatasetAttr.NEXT_PUBLIC_ZENDESK_FIELD_ID_VERSION]: process.env.NEXT_PUBLIC_ZENDESK_FIELD_ID_VERSION,diff --git a/web/config/index.ts b/web/config/index.tsindex 0e876b800ef..158d9976fc4 100644--- a/web/config/index.ts+++ b/web/config/index.ts@@ -375,6 +375,11 @@ export const ENABLE_WEBSITE_WATERCRAWL = getBooleanConfig(DatasetAttr.DATA_PUBLIC_ENABLE_WEBSITE_WATERCRAWL,false,)+export const ENABLE_SINGLE_DOLLAR_LATEX = getBooleanConfig(+ process.env.NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX,+ DatasetAttr.DATA_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX,+ false,+)export const VALUE_SELECTOR_DELIMITER = '@@@'diff --git a/web/docker/entrypoint.sh b/web/docker/entrypoint.shindex c12ebc08125..b32e6489227 100755--- a/web/docker/entrypoint.sh+++ b/web/docker/entrypoint.sh@@ -34,6 +34,7 @@ export NEXT_PUBLIC_MAX_TOOLS_NUM=${MAX_TOOLS_NUM}export NEXT_PUBLIC_ENABLE_WEBSITE_JINAREADER=${ENABLE_WEBSITE_JINAREADER:-true}export NEXT_PUBLIC_ENABLE_WEBSITE_FIRECRAWL=${ENABLE_WEBSITE_FIRECRAWL:-true}export NEXT_PUBLIC_ENABLE_WEBSITE_WATERCRAWL=${ENABLE_WEBSITE_WATERCRAWL:-true}+export NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX=${NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX:-false}export NEXT_PUBLIC_LOOP_NODE_MAX_COUNT=${LOOP_NODE_MAX_COUNT}export NEXT_PUBLIC_MAX_PARALLEL_LIMIT=${MAX_PARALLEL_LIMIT}export NEXT_PUBLIC_MAX_ITERATIONS_NUM=${MAX_ITERATIONS_NUM}diff --git a/web/types/feature.ts b/web/types/feature.tsindex 56fe0c0484f..05421f53c38 100644--- a/web/types/feature.ts+++ b/web/types/feature.ts@@ -122,6 +122,7 @@ export enum DatasetAttr {DATA_PUBLIC_ENABLE_WEBSITE_JINAREADER = 'data-public-enable-website-jinareader',DATA_PUBLIC_ENABLE_WEBSITE_FIRECRAWL = 'data-public-enable-website-firecrawl',DATA_PUBLIC_ENABLE_WEBSITE_WATERCRAWL = 'data-public-enable-website-watercrawl',+ DATA_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX = 'data-public-enable-single-dollar-latex',NEXT_PUBLIC_ZENDESK_WIDGET_KEY = 'next-public-zendesk-widget-key',NEXT_PUBLIC_ZENDESK_FIELD_ID_ENVIRONMENT = 'next-public-zendesk-field-id-environment',NEXT_PUBLIC_ZENDESK_FIELD_ID_VERSION = 'next-public-zendesk-field-id-version',