Everytime the user press the "Enter" key, a new <p> tag is created. Is there any way to avoid that new tag and use a <br> (or <br/>) instead? I need just one <p></p> per textarea.
<p> tag will be created.Expected behavior: New <br> tag for the new line.
Actual behavior: A new <p> tag is created.
@jimmyadaro Hey Dude) I thought about it too! I solved my problem like this:
let html = editor.api.getContent().replace(/\<p\>/ig,'<br>').replace(/\<\/p\>/ig,'');
The default behaviour is what makes sense to me, but I suppose it's a matter of personal taste. I expect it to create a <p> tag when I press Enter and a <br> tag when I press Shift+Enter.
What part of code controls the behaviour of Enter or Shift+Enter? Can we change that behaviour?
Edit: this is a duplicate of https://github.com/yabwe/medium-editor/issues/70
Just a suggestion, this could be a behavior tied to the setting disableDoubleReturn if this is true then enter/return could insert <br> instead of <p>.
Having the same request :) to have <br> instead of <p> disableDoubleReturn doesnt seem to add br but adds <p> instead
right now, if disabeReturn is false and disableDoubleReturn is true then you get a break when you hit Shift+Enter and just using Enter does nothing. This is something that would need to be changed in medium editor to use Enter for a single return in double return is disabled.
As @keligijus said above. This is being discussed in #70, you might want to check out that one.
Most helpful comment
The default behaviour is what makes sense to me, but I suppose it's a matter of personal taste. I expect it to create a
<p>tag when I press Enter and a<br>tag when I press Shift+Enter.