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>
56 KiB
56 KiB