deerflow2/web/src
Willem Jiang 58c1743ed5 fix: resolve math formula display abnormal after editing report
This fix addresses the issue where math formulas become corrupted or
incorrectly displayed after editing the generated report in the editor.

**Root Cause:**
The issue occurred due to incompatibility between markdown processing
in the display component and the Tiptap editor:
1. Display component used \[\] and \(\) LaTeX delimiters
2. Tiptap Mathematics extension expects $ and 70868 delimiters
3. tiptap-markdown didn't have built-in math node serialization
4. Math syntax was lost/corrupted during editor save operations

**Solution Implemented:**
1. Created MathematicsWithMarkdown extension that adds markdown
   serialization support to Tiptap's Mathematics nodes
2. Added math delimiter normalization functions:
   - normalizeMathForEditor(): Converts LaTeX delimiters to $/70868
   - normalizeMathForDisplay(): Standardizes all delimiters to 70868
3. Updated Markdown component to use new normalization
4. Updated ReportEditor to normalize content before loading

**Changes:**
- web/src/components/editor/math-serializer.ts (new)
- web/src/components/editor/extensions.tsx
- web/src/components/editor/index.tsx
- web/src/components/deer-flow/markdown.tsx
- web/src/core/utils/markdown.ts
- web/tests/markdown-math-editor.test.ts (new)
- web/tests/markdown-katex.test.ts

**Testing:**
- Added 15 comprehensive tests for math normalization round-trip
- All tests passing (math editor + existing katex tests)
- Verified TypeScript compilation and linting

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-10-15 08:52:50 +08:00
..
app feat: Add intelligent clarification feature in coordinate step for research queries (#613) 2025-10-14 13:35:57 +08:00
components fix: resolve math formula display abnormal after editing report 2025-10-15 08:52:50 +08:00
core fix: resolve math formula display abnormal after editing report 2025-10-15 08:52:50 +08:00
hooks feat(visualization): add workflow run animation logic 2025-04-29 16:46:50 +08:00
lib chore: add license header for web 2025-04-17 14:26:41 +08:00
styles FIX/Adapt message box to handle long text in frontend (#466) 2025-08-21 10:31:54 +08:00
typings chore: support raw-loader 2025-04-22 13:52:56 +08:00
env.js feat: show repo star on site-header (#27) 2025-05-12 14:36:50 +08:00
i18n.ts feat: add i18n support and add Chinese (#372) 2025-07-12 15:18:28 +08:00