feat: implement professional HTML ↔ Markdown conversion for group editing

- Add marked and turndown libraries for bidirectional conversion
- Create comprehensive MarkdownConverter utility with proper paragraph preservation
- Implement perfect round-trip HTML→Markdown→HTML conversion
- Add rich formatting support (bold, italic, paragraphs) with live preview
- Fix save handler conflict where general editor overwrote group changes
- Implement debounced live preview for group editing (500ms like regular elements)
- Enable dynamic paragraph creation/removal during markdown editing
- Add comprehensive test cases with HTML formatting examples

Result: World-class drop-in markdown editing with 29KB bundle size
This commit is contained in:
2025-09-07 21:22:12 +02:00
parent fdf9e1bb7e
commit bc1dcdffbd
6 changed files with 312 additions and 66 deletions

View File

@@ -115,9 +115,9 @@
<div>
<h3>Test 2: Group Editing (.insertr-group)</h3>
<div class="insertr-group" style="border: 2px solid #007cba; padding: 1rem;">
<p>This paragraph is part of a group.</p>
<p>Clicking anywhere in the group should open one markdown editor.</p>
<p>All content should be editable together as markdown.</p>
<p>This paragraph is part of a <strong>group</strong>.</p>
<p>Clicking anywhere should open one markdown editor with <em>rich formatting</em>.</p>
<p>All content should be <strong>editable together</strong> as markdown with proper <em>HTML conversion</em>.</p>
</div>
</div>
</div>