Skip to content

fix: render Help page Markdown content instead of plain text#947

Merged
hotlong merged 3 commits intomainfrom
copilot/fix-help-page-markdown-rendering
Mar 1, 2026
Merged

fix: render Help page Markdown content instead of plain text#947
hotlong merged 3 commits intomainfrom
copilot/fix-help-page-markdown-rendering

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 1, 2026

CRM Help page used type: 'text' components for Markdown-formatted content (#, **, -), which renders as plain text. The @object-ui/plugin-markdown component already exists and is registered in the console app.

  • examples/crm/src/pages/help.page.ts — Replace container of 8 text children with a single markdown component, consolidating content into one Markdown string
  • apps/console/src/__tests__/BrowserSimulation.test.tsx — Add import '@object-ui/plugin-markdown' to register the component in the test environment (matches existing pattern for dashboard/report/fields plugins)

Before:

{ type: 'text', properties: { value: '# CRM Help Guide', className: 'text-3xl font-bold mb-6 block' } },
{ type: 'text', properties: { value: '- **Dashboard** — KPI metrics...', className: 'whitespace-pre-line mb-6 block' } },

After:

{ type: 'markdown', properties: { className: 'max-w-3xl mx-auto p-8', content: '# CRM Help Guide\n\n...' } }
Original prompt

This section details on the original issue you should resolve

<issue_title>Help 页面未正确渲染 Markdown 内容,全部显示为纯文本</issue_title>
<issue_description>## 问题描述
在 CRM 应用的 Help 页面,Markdown 语法内容被当作普通文本显示,没有被解析成 HTML 样式。例如:\n- # CRM Help Guide 并未显示为标题;\n- 列表项、粗体等 Markdown 格式都未生效,所有内容都以原始文本形式展现。\n\n## 复现步骤\n1. 打开 demo.objectui.org,左侧菜单点击「Help」或「帮助」;\n2. 可见所有带有 #-** 等 Markdown 标记的文本未被格式化。\n\n见截图:\nHelp 页面纯文本问题\n\n## 根因分析\n查阅 examples/crm/src/pages/help.page.ts 可知:\n- Help 页面使用了多个 type: 'text' 组件承载 Markdown 内容;\n- text 组件仅以 形式渲染,不支持 Markdown;\n- 实际应使用 type: 'markdown' 组件(来自 @object-ui/plugin-markdown),已内置完整 GFM 支持与安全策略。\n\n## 预期修复方案\n- 用单个 type: 'markdown' 组件替换 Help 页面多个 text 组件,将内容合并为多行 Markdown 字符串,传给 content 字段;\n- 保持原有排版风格,适当设置 className(如 max-w-3xl mx-auto p-8);\n\n## 参考实现\ntypescript\n// 用 markdown 组件替代 text\n{\n type: 'markdown',\n properties: {\n content: `# CRM Help Guide\n...(所有原内容合并为 markdown 字符串)`\n }\n}\n\n\n## 附加信息\n- 相关插件:@object-ui/plugin-markdown\n- 问题截图见上\n- 参考文件:examples/crm/src/pages/help.page.ts\n\nCc @hotlong</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Mar 1, 2026 4:17pm
objectui-demo Ready Ready Preview, Comment Mar 1, 2026 4:17pm
objectui-storybook Ready Ready Preview, Comment Mar 1, 2026 4:17pm

Request Review

Replace multiple type:'text' components with a single type:'markdown'
component that properly renders Markdown syntax (headers, lists, bold).
The markdown plugin is already registered in the console app.

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix rendering of Markdown content on Help page fix: render Help page Markdown content instead of plain text Mar 1, 2026
@hotlong hotlong marked this pull request as ready for review March 1, 2026 16:14
Copilot AI review requested due to automatic review settings March 1, 2026 16:14
@hotlong hotlong merged commit 3eed89b into main Mar 1, 2026
4 of 5 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Markdown-formatted content on the CRM Help page rendering as plain text by switching the page schema to use the already-available markdown component and ensuring the markdown plugin is registered in the console test environment.

Changes:

  • Update CRM Help page schema to render its content via a single type: 'markdown' component (instead of multiple text nodes containing Markdown syntax).
  • Register @object-ui/plugin-markdown in the console browser simulation test setup via a side-effect import.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
examples/crm/src/pages/help.page.ts Replaces the prior container + multiple text children approach with a single markdown component and consolidated Markdown content.
apps/console/src/__tests__/BrowserSimulation.test.tsx Adds import '@object-ui/plugin-markdown' so the markdown renderer is registered during integration-style tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Help 页面未正确渲染 Markdown 内容,全部显示为纯文本

3 participants