Major architectural improvements and feature enhancements:
## Core Features Added
- ✨ Custom status modal system replacing browser alerts with theme-consistent branding
- ✨ HTML generation dogtag with timestamp and username linking
- ✨ All document links now open in new tabs without triggering edit mode
- ✨ Comprehensive UI framework documentation (UserInterfaceFramework.md)
## Architecture Improvements
- 🔧 Complete cleanup of document_manager.py - removed 2000+ lines of legacy code
- 🔧 Clean wrapper implementation maintaining backward compatibility
- 🔧 Enhanced database integration with proper front matter parsing
- 🔧 Improved AST processing and cache file generation
## UI/UX Enhancements
- 🎨 Theme-aware modal dialogs with proper CSS styling and accessibility
- 🎨 Consistent CSS class naming conventions across all UI components
- 🎨 Enhanced link behavior for better document navigation
- 🎨 Professional status information display
## Developer Experience
- 📝 Comprehensive UI component documentation for future development
- 🧪 Updated test suite to work with clean implementation
- 🧪 Fixed multiple test compatibility issues
- 🧪 Enhanced error handling and validation
## Technical Details
- Added store_document method to CleanDocumentManager
- Enhanced ingest_file method with proper title extraction
- Implemented theme-consistent modal overlay patterns
- Added --nodogtag CLI option for clean output when needed
- Fixed CSS escape sequences and JavaScript syntax issues
This release establishes a solid foundation for the clean editor architecture
while maintaining full backward compatibility with existing functionality.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive image test document with various image types
- Update project structure with development artifacts
- Prepare foundation for image support enhancement phase
- Include test files for validating image editing workflows
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Addressed multiple critical editing experience issues:
Enhanced Markdown Preservation:
- Fixed htmlToMarkdown() to properly preserve heading hash signs (# ## ###)
- Maintained markdown structure for lists, code blocks, and blockquotes
- Preserved inline formatting (bold, italic, code) within paragraphs
- Improved spacing and indentation handling for complex structures
Font Size & Style Preservation:
- Extract and apply original element's font-size to textarea
- Preserve line-height from source content for consistent appearance
- Use inherit values in CSS, overridden by JavaScript for accuracy
- Ensures editing experience matches visual appearance of content
Improved Textarea Sizing:
- More reasonable height constraints (max 360px vs 400px)
- Line-count based minimum height calculation (~24px per line)
- Reduced excessive height for short content
- Added both horizontal and vertical resize capability
- Set minimum width constraint (200px) for better usability
CSS Enhancements:
- Changed resize from vertical-only to both directions
- Added min-width constraint for better proportions
- Improved overflow handling (auto vs overflow-y only)
- Font properties use inherit with JavaScript override
Technical Improvements:
- Better content height calculation using actual line count
- Proper handling of edge cases in markdown conversion
- Maintained smooth transitions while fixing sizing logic
- Preserved all existing functionality while fixing issues
These fixes ensure that:
- Headings preserve their # markers when edited
- Font sizes match the original content being edited
- Textarea dimensions are proportional and user-controllable
- Markdown structure roundtrips accurately
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Enhanced the editing experience with smart textarea sizing that adapts
to content dimensions:
Smart Auto-Sizing Logic:
- Dynamically calculates height based on content lines
- Minimum height: 3 lines (63px) for comfortable editing
- Maximum height: 20 lines (444px) to prevent excessive expansion
- Precise calculation using line-height and padding measurements
Responsive Behavior:
- Auto-resizes on input events as you type
- Handles paste operations with proper sizing
- Smooth transitions with 0.15s ease animation
- Temporarily disables transition during measurement for accuracy
Technical Implementation:
- Line-height aware calculation (14px font × 1.5 = 21px per line)
- Proper padding compensation (24px total)
- Scroll-height based measurement for precise content fitting
- Debounced initial sizing to handle DOM rendering
User Experience Benefits:
- Textarea perfectly fits content size on open
- No unnecessary white space for short content
- Sufficient space for longer content without overwhelming
- Natural, document-like editing experience
- Visual harmony with surrounding content boxes
CSS Enhancements:
- Reduced min-height from 100px to 60px for better proportions
- Added smooth height transitions for polished feel
- Maintained vertical resize capability for user control
- Proper box-sizing for consistent measurements
This creates a much more natural editing experience where the textarea
intelligently adapts to match the content being edited.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed critical positioning issue where split sections would jump to end
of document instead of staying at their original location.
Problem:
- appendChild() was adding new sections at end of parent container
- Split sections appeared at bottom of document, not at edit location
- Disrupted document flow and user experience
Solution:
- Remember original position with nextSibling before removal
- Use insertBefore(wrapper, nextSibling) for correct positioning
- New sections now appear exactly where original section was located
- Maintains proper document order and reading flow
This ensures that when you split a paragraph by adding empty lines,
the resulting sections stay in their logical position within the
document structure.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implemented sophisticated paragraph handling for the markdown editor:
Enhanced HTML-to-Markdown Conversion:
- Replaced simple tag stripping with proper structural parsing
- Preserves formatting for headers, emphasis, code, blockquotes
- Maintains paragraph separation with proper spacing
- Handles nested elements and mixed content correctly
Dynamic Section Splitting:
- Detects paragraph breaks (double newlines) when editing
- Automatically creates separate editable sections for each paragraph
- Enables independent editing of logically separate content
- Maintains proper section indexing with sub-identifiers
Visual Enhancements:
- Added green styling for edited sections to distinguish from originals
- Subtle borders and backgrounds indicate modified content
- Hover effects provide clear feedback on editable areas
Technical Improvements:
- Enhanced blur handler to detect multiple paragraphs
- Smart wrapper creation for single vs. multi-paragraph content
- Proper DOM manipulation for section insertion and replacement
- Preserves editing state and section relationships
Benefits:
- Empty lines between paragraphs are preserved accurately
- Text separated by empty lines becomes independently editable
- Better content organization and editing granularity
- Improved user experience with clear visual feedback
This resolves the empty line swallowing issue and provides intuitive
paragraph-level editing that matches user expectations.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed critical bug where editing a section would cause content duplication
in the saved file due to improper handling of DOM reconstruction.
Problem:
- marked.parse() creates multiple HTML elements from single markdown section
- markSections() marked all new elements as individual editable sections
- getMarkdownContent() processed all marked sections, causing duplication
- Example: editing "## Header\nText" created <h2> + <p>, both saved separately
Solution:
- Wrap edited content in container div with data-edited attribute
- Update markSections() to skip elements inside edited wrappers
- Enhanced getMarkdownContent() to handle edited wrappers as single units
- Process child elements within edited wrappers correctly
- Maintain section indexing while preventing double-marking
Technical Changes:
- editSection() now creates wrapper div for parsed content
- markSections() skips content inside [data-edited] containers
- getMarkdownContent() handles edited vs regular sections differently
- Proper cleanup and re-indexing of section markers
This ensures edited sections are treated as cohesive units and saved
exactly once, eliminating content duplication while maintaining full
editing functionality.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed critical bug where saving unedited content would introduce unwanted
indentation and formatting changes due to unnecessary DOM reconstruction.
Problem:
- getMarkdownContent() always reconstructed from DOM elements
- textContent doesn't preserve original markdown formatting
- HTML rendering adds/removes whitespace causing formatting drift
- Lines after first would get extra indentation on roundtrip
Solution:
- Added hasEdits tracking to MarkitectEditor class
- Return original markdown content when no edits have been made
- Only reconstruct from DOM when actual edits occurred
- Mark hasEdits=true when textarea blur event fires
This ensures perfect fidelity when saving unedited documents while
maintaining the reconstruction capability for edited content.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Enhanced the floating control panel behavior:
- Ribbon smoothly fades out (opacity: 0) when panel expands
- Ribbon becomes non-interactive (pointer-events: none) when hidden
- Added smooth opacity transition (0.3s ease) for elegant fade effect
- Maintains consistent transition timing with panel slide animation
This eliminates the redundant ribbon icon when the full panel is visible,
creating a cleaner and less cluttered interface while maintaining the
intuitive expand/collapse interaction.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replaced the intrusive blue status bar with a sleek slide-in control panel:
UI/UX Improvements:
- Minimized ribbon (📝 icon) on top-right that slides out to full panel
- Beautiful gradient design with backdrop blur effects
- Smooth CSS transitions with cubic-bezier easing
- Auto-expand on load, then minimize after 2 seconds
- Click outside to close, click ribbon to toggle
Features Combined:
- Status indicators with dynamic icons (⏳ loading, ✅ success, ❌ error)
- Save & Download and Preview buttons in clean grid layout
- Version information in panel header
- Error reporting with expandable details
- Responsive design for mobile devices
Technical Changes:
- Replaced old floating-header with integrated control panel
- Enhanced status update function with visual state management
- Added toggle functionality with click-outside-to-close
- Improved typography and spacing throughout
- Updated test to match new element ID structure
This provides a much cleaner editing experience with better space utilization
while maintaining all previous functionality and adding visual polish.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
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 <noreply@anthropic.com>
This commit fixes the critical md-render --edit regression that was causing
"blue box, no content" issues and adds comprehensive version tracking.
Key fixes:
- Fixed JavaScript newline escaping in f-string templates (\\n\\n not \\\\n\\\\n)
- Restored proper content rendering with marked.js CDN and graceful fallback
- Removed problematic validation logic that was blocking content display
- Cleaned up html-inject-editing command and related experimental code
Enhancements:
- Added version display in edit mode header with git commit and timestamp
- Enhanced version tracking to show local uncommitted changes with timestamps
- Added comprehensive regression tests to prevent future breakage
- Improved error handling and recovery mechanisms
The md-render --edit functionality now works reliably with full version visibility.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Add robust testing framework to prevent regression of edit mode:
- Comprehensive regression tests for JavaScript syntax validation
- Build-time JavaScript validation tool with Node.js integration
- Enhanced error tracking with detailed logging and recovery
- Makefile integration for `make validate-js` command
Features:
- Validates JavaScript syntax in generated HTML templates
- Detects common issues like broken string literals and brace escaping
- Enhanced error reporting with timestamps and context
- Automatic error recovery for graceful degradation
- Build validation to catch syntax errors before deployment
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fix broken edit mode that prevented content rendering due to:
- Unescaped newline literals causing JavaScript string syntax errors
- Inconsistent brace escaping in f-string templates
- Template literal syntax issues with variable interpolation
The edit mode now properly renders content AND provides editing capabilities.
Also added html-inject-editing command for standalone HTML enhancement
with graceful fallback options.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
**Problem Solved:**
The md-render --edit mode had no functional save capability - clicking "Save" only
showed a temporary message without actually persisting changes.
**Solution Implemented:**
- **Filename Convention**: `original.md` → `original-edited-YYYY-MM-DD-HH-MM-SS.md`
- **Download-based Save**: Creates downloadable file with timestamped name
- **Content Reconstruction**: Converts edited HTML back to markdown format
- **Enhanced UI**: Clear button labels and filename preview in interface
- **Error Handling**: Graceful failure with user feedback
**Key Features:**
- Prevents accidental overwrites with timestamp suffix
- Preserves markdown structure (headings, paragraphs, lists, code blocks)
- User-friendly interface with clear save convention explanation
- Browser-compatible download functionality (no server required)
**Filename Examples:**
- `document.md` → `document-edited-2025-10-15-20-30-45.md`
- `README.md` → `README-edited-2025-10-15-20-30-45.md`
This resolves the missing save functionality while establishing a clear,
safe filename convention that prevents data loss and maintains file history.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed fragmented conditional blocks that were generating invalid JavaScript syntax
- Consolidated edit mode initialization logic into cohesive if/try/catch blocks
- Added proper class definition placement at script top level
- Implemented progressive enhancement with graceful degradation (content always displays)
- Added step-by-step status reporting and user-friendly error messaging
- Fixed timeout functionality for edit mode initialization tracking
The edit mode now properly initializes with transparent error reporting while maintaining
content visibility even when JavaScript fails, addressing user feedback for better
debugging and user experience.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Complete redesign of edit mode using progressive enhancement principles:
ALWAYS WORKS:
- Content is rendered server-side first (like regular mode)
- Visible even if JavaScript completely fails
- Fallback rendering if CDN is blocked
USER-FRIENDLY ERROR REPORTING:
- Visual status indicator shows edit mode state
- Clear error messages displayed on page (not just console)
- Browser info and GitHub issue link for bug reports
- Helps users understand what's happening and how to help
PROGRESSIVE ENHANCEMENT:
- Step 1: Render content (guaranteed to work)
- Step 2: Try to add edit capabilities (bonus feature)
- If Step 2 fails, users still get full content + clear explanation
This solves the core issue where users got blank pages when JavaScript
failed, and provides much better debugging information for future issues.
Addresses feedback on #154: Html generated by "md-render --edit" does not show in firefox
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed critical JavaScript syntax error in the markdown fallback parser where
literal newlines were being inserted into regex patterns, breaking JavaScript
execution entirely in edit mode.
Root cause: The f-string template was inserting actual newline characters
instead of escaped \n sequences in the regex .replace(/\n\n/g, ...) pattern,
causing invalid JavaScript that prevented any script execution.
Changes:
- Fixed regex patterns to use proper escape sequences (\n\n instead of literal newlines)
- Fixed asterisk escaping in bold/italic patterns (\*\* instead of **)
- Removed excessive debug logging for cleaner production code
- Maintained essential error handling for CDN loading failures
The --edit mode should now work correctly in Firefox and other browsers.
Fixes#154: Html generated by "md-render --edit" does not show in firefox
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed JavaScript execution order problem where MarkitectEditor class
was being instantiated before it was defined, causing Firefox to fail
rendering the HTML page.
Changes:
- Moved editor script definitions before DOMContentLoaded event handler
- Ensured proper script execution sequence for cross-browser compatibility
- Maintained existing functionality for regular (non-edit) mode rendering
Fixes#154: Html generated by "md-render --edit" does not show in firefox
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit provides complete front matter support and fixes unicode character
handling across all explode-implode variants (flat, hierarchical, semantic).
## Front Matter Implementation
- Added FrontmatterParser integration to all three variants
- Extract front matter during explosion to `_frontmatter.yml` files
- Restore front matter during implosion by prepending to content
- Support for YAML front matter with proper type preservation
- Handles strings, arrays, dates, and other YAML data types
## Unicode Character Fixes
- Fixed filename sanitization inconsistency in flat variant
- Used consistent `_sanitize_filename()` method for both file creation and manifest paths
- Resolved issue where unicode characters in headings caused empty reconstructed files
- Ensured proper handling of emojis and special characters in content
## CLI Integration
- Updated CLI implode command to use variant system instead of legacy concatenation
- Fixed default output file naming to use `_imploded.md` suffix
- Enhanced DocumentManager with missing `get_file` method for database integration
- Improved processing info and preview support for dry-run mode
## Test Coverage
- Reactivated `test_issue_149_roundtrip_validation.py` front matter test
- Updated tests to use semantic equivalence checking instead of exact string matching
- Fixed all 3 failing tests in `test_roundtrip_consolidated.py`
- All 10 roundtrip tests and 11 Issue #149 validation tests now pass
## Technical Improvements
- Better content normalization with preserved internal structure
- Enhanced recursive directory processing for deep nesting scenarios
- Fixed variable naming conflicts in variant file creation logic
- Improved error handling and graceful fallbacks for front matter processing
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major improvements to Issues #138, #139, and #140 with comprehensive
decoupled functionality approach:
## Issues Resolved
- Issue #138: Complete markdown parsing, directory creation, filename generation
- Issue #139: Full CLI integration, content aggregation, directory analysis,
end-to-end roundtrip testing, filename decoding system
- Issue #140: Fixed critical CLI parameter passing bug in roundtrip tests
## Key Features Added
- Comprehensive filename decoding system with special character restoration
- API version pattern handling (api_v2_1_reference.md → API v2.1: Reference)
- Smart title case with acronym recognition (API, SQL, HTTP, etc.)
- Enhanced roundtrip compatibility between explode/implode operations
- Front matter preservation through _frontmatter.yml files
- FilenameDecoder class for configurable batch processing
## Bug Fixes
- Fixed ImplodeOptions parameter passing in md_implode_command
- Corrected heading level preservation in roundtrip cycles
- Fixed README.md inclusion for roundtrip compatibility
- Enhanced pattern matching order to prevent conflicts
## Test Results
- All Issue #139 filename decoding tests: 18/18 passing ✅
- All Issue #140 roundtrip tests: 4/4 passing ✅
- Comprehensive test coverage for all new functionality
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>