xdan / jodit

Jodit - Best WYSIWYG Editor for You
https://xdsoft.net/jodit/
MIT License
1.61k stars 341 forks source link

cleanHTML fillEmptyParagraph and removeEmptyElements seem broken #1149

Open Paul-Yves opened 3 weeks ago

Paul-Yves commented 3 weeks ago

Jodit Version: 4.2.25

Browser: firefox OS: linux Is React App: False Reproduced on xdsoft.net: False Code

import { Jodit } from 'jodit/esm/index.js'
import 'jodit/esm/plugins/clean-html/clean-html.js'
Jodit.make($('textarea'), {
    cleanHTML: {
      fillEmptyParagraph: false,
      removeEmptyElements: true
    }
  })

Expected behavior: When textarea is empty at start, if I write thing in the jodit editor then delete everything, the textarea value submitted in a form should be empty Actual behavior: When textarea is empty at start, if I write thing in the jodit editor then delete everything, the textarea value submitted in a form is <p><br/></p>