Tijdlijn-detectielus extraheren uit 5 markdown-conversie services #2075

Closed
opened 2026-09-13 08:05:56 +00:00 by brenno · 0 comments
Owner

Probleem

Dezelfde tijdlijn-detectielus staat in vijf markdown-naar-format converters. De eerste ~20 regels zijn identiek; alleen de output-rendering verschilt per formaat.

De gedeelde structuur:

  1. Regels opsplitsen, marker + tabel detecteren
  2. Tabelregels verzamelen tot einde
  3. analyzeMarkedTimeline aanroepen
  4. Als timeline != null: formaat-specifieke rendering
  5. Anders: originele regels doorgeven

Betrokken bestanden

Bestand Functie Regels
services/docx/markdown_to_docx.dart _protectDocumentTimelines 167-229
services/odt/markdown_to_odt.dart _protectDocumentTimelines 164-230
services/epub/markdown_to_xhtml.dart _protectDocumentTimelines 135-181
services/latex/markdown_to_latex.dart _protectDocumentTimelines 114-160
services/pdf/markdown_to_pdf_blocks.dart _protectTimelines 204-240

Voorstel

Extraheer de detectielus naar een gedeelde functie die een callback voor formaat-specifieke rendering accepteert. Elke converter geeft alleen het renderwerk mee.

Schatting

~40-50 regels verwijderbaar.

Labels

duplicate, enhancement

## Probleem Dezelfde tijdlijn-detectielus staat in vijf markdown-naar-format converters. De eerste ~20 regels zijn identiek; alleen de output-rendering verschilt per formaat. De gedeelde structuur: 1. Regels opsplitsen, marker + tabel detecteren 2. Tabelregels verzamelen tot einde 3. `analyzeMarkedTimeline` aanroepen 4. Als timeline != null: formaat-specifieke rendering 5. Anders: originele regels doorgeven ## Betrokken bestanden | Bestand | Functie | Regels | |---|---|---| | `services/docx/markdown_to_docx.dart` | `_protectDocumentTimelines` | 167-229 | | `services/odt/markdown_to_odt.dart` | `_protectDocumentTimelines` | 164-230 | | `services/epub/markdown_to_xhtml.dart` | `_protectDocumentTimelines` | 135-181 | | `services/latex/markdown_to_latex.dart` | `_protectDocumentTimelines` | 114-160 | | `services/pdf/markdown_to_pdf_blocks.dart` | `_protectTimelines` | 204-240 | ## Voorstel Extraheer de detectielus naar een gedeelde functie die een callback voor formaat-specifieke rendering accepteert. Elke converter geeft alleen het renderwerk mee. ## Schatting ~40-50 regels verwijderbaar. ## Labels duplicate, enhancement
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
LibreKAT/Ocideck#2075
No description provided.