fix: preserve valid bold markdown in rich editor

This commit is contained in:
lucaronin
2026-04-16 22:31:19 +02:00
parent 3bcfedda5b
commit 2b85f4e45f
3 changed files with 82 additions and 22 deletions

View File

@@ -122,7 +122,17 @@ describe('compactMarkdown', () => {
it('decodes   HTML entities from BlockNote bold+code output', () => {
const input = '**Remove **`NoteWindow`** and render the full **`App`** component.**\n'
expect(compactMarkdown(input)).toBe('**Remove **`NoteWindow`** and render the full **`App`** component.**\n')
expect(compactMarkdown(input)).toBe('**Remove** `NoteWindow` **and render the full** `App` **component.**\n')
})
it('moves trailing whitespace outside bold markers', () => {
const input = '**Luca **\n'
expect(compactMarkdown(input)).toBe('**Luca** \n')
})
it('moves leading whitespace outside bold markers', () => {
const input = '** Luca**\n'
expect(compactMarkdown(input)).toBe(' **Luca**\n')
})
it('decodes multiple HTML entity types', () => {