javascripthtmljqueryjhtmlarea

jHtmlArea newlines creating div tag and not a paragraph tag


We're using jHtmlArea in our site for the html input elements. I've noticed in our implementation adding a newline generates a new div tag wrapping a br tag. Adding text to the line removes the br tag with resulting html renders with no breaks.

On the example provided here: https://pietschsoft.com/Demo/jHtmlArea/Default.htm

Adding a line creates a paragraph tag rather than a div+br. Has anyone seen something similar where it's required to add two lines in order to get a line break?

Some thoughts on next steps to debug this issue or just get used to the two-line method?

Edit:

Relevant jsfiddle - https://jsfiddle.net/xrtaw4k8/1/

<script type="text/javascript" src="https://pietschsoft.com/Demo/jHtmlArea/scripts/jHtmlArea-0.8.alpha.min.js"></script>
<script type="text/javascript" src="https://pietschsoft.com/Demo/jHtmlArea/scripts/jHtmlArea.ColorPickerMenu-0.8.alpha.min.js"></script>
<!--http://rs.01298.com/rs/lib/js/jHtmlArea-0.8.min.js-->
<link rel="stylesheet" href="https://pietschsoft.com/Demo/jHtmlArea/content/jHtmlArea/jHtmlArea.ColorPickerMenu.css">
<link rel="stylesheet" href="https://pietschsoft.com/Demo/jHtmlArea/content/jHtmlArea/jHtmlArea.css">
<link rel="stylesheet" href="https://pietschsoft.com/Demo/jHtmlArea/content/bootstrap/bootstrap.min.css">

<div>
  <textarea cols=90 rows=50></textarea>
</div>

Script:

$('document').ready(function() {
    $('textarea').htmlarea();
});

Solution

  • So I discovered the reason why one is producing paragraph tags the other div tags.. apparently if the text area is seeded with

    tags then each new line will be surrounded with p tags as well? As Chris mentioned above it's a quirk of Chrome and not anything the library is doing.