tractatus/src/controllers
TheFlow 65a859ed00 fix(i18n): workaround for mangled markdown in translations
Problem:
- DeepL API with tag_handling='html' mangled markdown structure
- Translated markdown lost H2 headers and line breaks
- Sections couldn't be extracted from translated content
- Frontend showed no cards for translated documents

Root Cause:
- DeepL's HTML tag handling treated markdown as HTML
- Result: HTML entities (>), no line breaks, corrupted structure

Workaround Solution:
- Use English document sections (preserved structure)
- Display translated document title
- Card titles in English, but card content uses translated HTML
- This allows cards to render correctly while preserving UX

Files Changed:
- src/utils/sections.util.js: Section extraction utilities (created)
- src/controllers/documents.controller.js: Return English sections for translations

Limitations:
- Card section titles remain in English
- Full translated content still displays correctly
- TODO: Re-translate with proper markdown preservation

🌐 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 01:48:28 +13:00
..
admin.controller.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
analytics.controller.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
audit.controller.js feat(blog): integrate Tractatus framework governance into blog publishing 2025-10-25 08:47:31 +13:00
auth.controller.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
blog.controller.js feat(cultural-sensitivity): implement Phase 1 - detection and flagging (inst_081) 2025-10-25 11:10:06 +13:00
cases.controller.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
contact.controller.js feat(crm): implement unified contact form system 2025-10-24 16:56:21 +13:00
crm.controller.js feat(crm): complete Phase 3 multi-project CRM + critical bug fixes 2025-10-24 18:10:14 +13:00
documents.controller.js fix(i18n): workaround for mangled markdown in translations 2025-10-26 01:48:28 +13:00
inbox.controller.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
koha.controller.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
media.controller.js feat(cultural-sensitivity): implement Phase 1 - detection and flagging (inst_081) 2025-10-25 11:10:06 +13:00
newsletter.controller.js fix(newsletter): serialize ObjectId to string in API response 2025-10-24 20:29:12 +13:00
projects.controller.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
publications.controller.js feat(blog): add Manage Submission modal for publication tracking 2025-10-24 01:55:06 +13:00
relationships.controller.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
rules.controller.js feat: implement Rule Manager and Project Manager admin systems 2025-10-11 17:16:51 +13:00
submissions.controller.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
variables.controller.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00