From 6df6430b72b932f7df4c0004d60fe1945611661a Mon Sep 17 00:00:00 2001 From: tegwick Date: Sat, 25 Oct 2025 20:37:32 +0200 Subject: [PATCH] fix: resolve CSS embedding import error in HTML template generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed critical bug where CSS files were not being embedded inline due to missing Path import in _generate_html_template method. This was causing CSS content to fall back to link tags instead of inline embedding. The issue was: - Path used in CSS handling code (line 367) before being imported - Path import was conditional and occurred later in the method (line 623) - Exception handling silently fell back to link tags Solution: - Added explicit `from pathlib import Path` import at method start - CSS files now properly embed inline as intended - All CSS-related tests now pass (6/6 previously failing) This resolves the test failures where CSS content was expected to be embedded inline but was generating link tags instead. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- markitect/document_manager.py | 1 + 1 file changed, 1 insertion(+) diff --git a/markitect/document_manager.py b/markitect/document_manager.py index 1d56de9e..7e8ad445 100644 --- a/markitect/document_manager.py +++ b/markitect/document_manager.py @@ -355,6 +355,7 @@ class DocumentManager: edit_mode: bool = False, editor_theme: str = 'github', keyboard_shortcuts: bool = True) -> str: """Generate HTML template with embedded markdown and client-side rendering.""" import json + from pathlib import Path # Escape the markdown content for JavaScript js_markdown_content = json.dumps(markdown_content)