Skip to content

feat: detect and convert markdown tables to HTML in publication texts#275

Open
Heitorh3 wants to merge 3 commits intomainfrom
feat/markdown-table-detection
Open

feat: detect and convert markdown tables to HTML in publication texts#275
Heitorh3 wants to merge 3 commits intomainfrom
feat/markdown-table-detection

Conversation

@Heitorh3
Copy link
Contributor

@Heitorh3 Heitorh3 commented Mar 9, 2026

Summary

  • Add _has_markdown_table static method to TextDictHandler that detects markdown tables via standard separator (---|---|---) or lines with 3+ pipes
  • When any text in the dataframe contains a markdown table, convert all texts to HTML using the markdown library with the tables extension
  • Add comprehensive tests covering: standard markdown separator, pipe-delimited table (3+ pipes), plain text (no table), lines with only 2 pipes, empty string, and separator with column alignment

Test plan

  • All 6 parametrized cases in test_has_markdown_table pass
  • Existing tests remain passing

🤖 Generated with Claude Code

Heitorh3 added 3 commits March 9, 2026 14:56
…blicação

Adicionar o método estático `_has_markdown_table` ao `TextDictHandler` para identificar
textos que contenham tabelas Markdown (separador padrão ou 3 ou mais barras verticais).

Quando detectadas, converter o Markdown para HTML usando a extensão de tabelas.

Adicionar testes abrangentes que cubram todos os casos de detecção.
… abstract

Mover a responsabilidade de remover tags HTML dos textos de publicação
para os notification senders, preservando o HTML no campo `abstract`
retornado pelo `transform_search_results`.

- Adicionar função `remove_html_tags` em `isender.py` (com normalização
  de espaços e unescape de entidades HTML), substituindo as implementações
  duplicadas em `SlackSender`, `DiscordSender` e `NotificationSender`
- Remover chamada de `_remove_html_tags` do pipeline do `TextDictHandler`,
  permitindo que o `abstract` preserve tabelas HTML e formatação original
- Adicionar estilo CSS para tabelas no template de e-mail `dou_template.html`
- Adicionar método `_prettier_html` ao `TextDictHandler` para formatação
  de HTML (a ser utilizado em etapas futuras do pipeline)
- Atualizar testes de `test_transform_search_results` para refletir o novo
  comportamento (abstract com HTML/texto bruto)
- Remover testes de `_remove_html_tags` das classes de sender (método removido)
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.

1 participant