0

Normally when we type a sentence in an wysiwyg editor and if we need one in next line we use to press the enter key and it will automatically insert a <br> tag. But when we use the jeditable WYSIWYG editor and do this it is inserting <p></p> tags instead of <br> in internet explorer and tag in chrome.

But it is inserting <br> tag in Mozilla (which is the right one). On IE is providing <p> tag instead of <br> when pressing enter key in jeditable WYSIWYG editor.

I am using Jeditable as inline editor (see demo). When using the wysiwyg editor and when I enter my sentence to the next line Firefox is showing the output using </br> tag which is the right one.

But chrome and internet explorer is showing different output.

For example:

The original output should be Lorem Ipsum<br>is simply dummy which is showing correctly in Firefox.

But in Internet Explorer the output is <p>Lorem Ipsum</p><p>is simply dummy</p> and in Chrome it is <div>Lorem Ipsum</div><div>is simply dummy</div>

How would I make this the same for all the browsers like Firefox is showing?

kenorb
  • 26,615

1 Answers1

0

The demo is using very old version of jWYSIWYG plugin (as suggested here), therefore you should use the upgraded code.

This was happening because when the editor is initialized and no content is load from textarea, it put an <br>.

Here is the commit fix that you're probably looking for:

Explanation of brIE-option in README and some code refactoring for the same functionality authored by stianlik.

The ENTER key will no longer reset the style to "Paragraph", but continue writing "Header 1" until users explicitly choose "Paragraph" in the toolbar.

You may use brIE option to control this behaviour. Check the README for more details.

Related:

kenorb
  • 26,615