Files
TimeTracker/app/static
Dries Peeters 0e9f461e90 fix: improve rich text rendering and invoice editor preview functionality
This commit addresses several issues with rich text display and the invoice
PDF layout editor:

Rich Text Rendering:
- Enhanced markdown filter to properly detect and preserve HTML content
  from WYSIWYG editor, allowing full rich text styling (colors, fonts,
  alignment) to be displayed correctly
- Improved HTML detection logic to distinguish between HTML and markdown
  content, ensuring markdown lists are properly processed
- Added support for style, class, and id attributes on all rich text
  elements (p, div, span, headings, lists, tables, etc.)
- Fixed list rendering in project/task descriptions with improved CSS:
  - Added explicit display properties for lists
  - Set proper list-style-type (disc for ul, decimal for ol)
  - Improved spacing and nested list support

Invoice Editor Improvements:
- Fixed table header text extraction: now reads actual header text from
  canvas elements instead of hardcoding English text, supporting
  internationalization (e.g., German headers)
- Preserved text alignment (left, center, right) in generated preview
  by reading Konva Text align attribute and applying text-align CSS
- Fixed PDF preview to show updated template:
  - Changed generateCode() to return template body content instead of
    full HTML document (matches preview endpoint expectations)
  - Added cache-busting to preview requests to prevent stale content
  - Improved error handling in preview fetch

Files changed:
- app/utils/template_filters.py: Enhanced markdown filter with HTML
  detection and style preservation
- app/static/enhanced-ui.css: Improved list styling for prose content
- templates/admin/pdf_layout.html: Fixed table header extraction, text
  alignment preservation, and preview generation format
2025-11-20 21:23:14 +01:00
..
2025-10-21 20:03:21 +02:00
2025-08-16 21:49:43 +02:00