yabwe / medium-editor

Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.
https://yabwe.github.io/medium-editor/
Other
16.04k stars 1.85k forks source link

remove paragraph & break tag from empty text editor. #1576

Open rajat-madaan opened 3 years ago

rajat-madaan commented 3 years ago

when I am deleting everything from text editor still medium editor adding a paragraph with a break inside it. You can see the attached image.

issue

I want to remove that paragraph & break the tag if I don't have any content inside my text editor.

Can anyone please help with the same?

Thanks.

ariel-devsar commented 3 years ago

Hi @rajatmadaan786 hey I'm having the same issue, did you find a solution for that?.

I can remove all the string when the value in the input is an empty string I can return an empty string instead of <p><br></p> because I need to show another thing when the value is an empty string, but everytime you remove one character is adding the <P> and that is anoying to check everytime that case

did you find some config or elegant solution to fix that?