Support Markdown tables in notes and guides

未關閉
#38 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
78/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
活躍
領域
content

研究方向

Start with SAFE_MDX_OPTIONS in src/lib/mdx-safe.ts and NoteBody in src/components/note-body.tsx to trace how notes and guides are rendered and sanitized. Then review src/components/mdx-components.tsx, src/lib/mdx-safe.test.ts, and the content guide. Done when tables compile, raw HTML in cells remains rejected, wide tables scroll within their container on phones, and the guide documents the syntax.

由索引模型根據 Issue 內容生成。

描述

enhancement help wanted

Problem

Notes and guides cannot use Markdown tables. The content guide says: "Tables need a plugin that is not installed yet, so avoid them for now." Tables are useful in study notes, for example to compare data structures or complexity.

Where it happens

Notes (/dashboard/...) and guides (/guides/...) render through NoteBody in src/components/note-body.tsx, using SAFE_MDX_OPTIONS from src/lib/mdx-safe.ts. That file also rejects raw HTML, JSX, and {expressions} for safety.

Suggested approach

  1. Add remark-gfm to remarkPlugins in SAFE_MDX_OPTIONS, keeping remarkRejectJsx.
  2. Style tables in src/components/mdx-components.tsx. Wide tables must scroll inside their own container on a phone instead of widening the page.
  3. Add tests to src/lib/mdx-safe.test.ts: a table compiles, and raw HTML inside a table cell is still rejected.
  4. Update the content guide to explain table syntax and remove the "avoid tables" line.

remark-gfm also enables strikethrough, task lists, footnotes, and autolinks. Mention in the pull request which of these you checked.

Check your change

npm run lint
npm run typecheck
npm test
npm run build
npm run e2e

Please comment with your plan before starting, since this touches the content security pipeline.

主要語言
TypeScript
星號
1
分支
1
平均合併
8 小時 58 分鐘
30 天內合併 PR
37

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

procoderji-com/procoderji 的其他 Issue

查看 procoderji-com/procoderji 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。