ZSSRichTextEditor icon indicating copy to clipboard operation
ZSSRichTextEditor copied to clipboard

Paragraphs result in <div> sometimes

Open fabb opened this issue 11 years ago • 4 comments

Sometimes the editor inserts

tags when inserting line breaks.

Correct Handling

  • Switch to HTML View, delete all content, and switch back to editor
  • Press "P" toolbar button
  • Type "Test", then Return, then "Test"
  • => The HTML code looks like this:
<p>Test</p>
<p>Test</p>

Wrong Handling 1

  • Switch to HTML View, delete all content, and switch back to editor
  • Type "Test", then Return, then "Test"
  • => The HTML code looks like this:
Test
<div>Test</div>

Wrong Handling 2

  • Switch to HTML View, delete all content, and switch back to editor
  • Press "UL" toolbar Button
  • Type "Test", then Return, then Return, then "Test"
  • => The HTML code looks like this:
<ul>
    <li>Test</li>
</ul>
<div>Test</div>

Wrong Handling 3

  • Switch to HTML View, delete all content, and switch back to editor
  • Press "P" toolbar Button
  • Press "UL" toolbar Button
  • Type "Test", then Return, then Return, then "Test"
  • => The HTML code looks like this:
<p>
    <ul>
        <li>Test</li>
    </ul>
    <div>Test</div>
</p>
  • Now, without typing anything, switch to HTML, then back to WYSIWYG, then back to HTML
  • => The HTML code looks like this:
<p>
</p>
<ul>
    <li>Test</li>
</ul>
<div>Test</div>
<p>
</p>

Wrong Handling 4

  • Switch to HTML View, delete all content, and switch back to editor
  • Press "P" toolbar Button
  • Type "Test"
  • Press "HR" toolbar Button
  • Type "Test", then Return, then "Test"
  • => The HTML code looks like this:
<p>Test</p>
<hr />Test
<div>Test</div>

fabb avatar Nov 18 '14 12:11 fabb

The question is if

tags should always be used for line breaks?

fabb avatar Nov 18 '14 12:11 fabb

@fabb I think that

tags should always be used for line breaks, I will have a look into this.

willptswan avatar Sep 02 '16 22:09 willptswan

I am facing same issue and stuck between this <div> tag. Any progress on this or any idea how to solve this issue ?

imsrc21 avatar Sep 14 '16 06:09 imsrc21

@imsrc21 I am currently working on fixing this, so far everything I have tried hasn't worked but I am still hoping to have this fix in the next commit that I do.

willptswan avatar Sep 16 '16 17:09 willptswan