Support Markdown tables in notes and guides

Aberta
#38 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
78/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
next.js, react, typescript
Domínio
content

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
1
Forks
1
Merge médio
8h 58min
PRs com merge (30d)
37

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de procoderji-com/procoderji

Todas as issues de procoderji-com/procoderji

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.