w8tcha / CKEditor-TextSelection-Plugin

The plugin that makes the editor keep it's text-selection when switching between WYSIWYG and Source mode, and scrolls the selection into the viewport.
MIT License
10 stars 7 forks source link

Empty paragraphs added #5

Closed mdenburger closed 10 years ago

mdenburger commented 10 years ago

The textselection plugin adds empty paragraphs when switching from normal view to source view.

First reproduction path:

  1. clone ckeditor 4.4.1
  2. add the textselection plugin
  3. enable the textselection plugin in samples/replacebycode.html
  4. clear all text in the editor
  5. switch to source mode

Expected: the source is empty Actual: the source is <p>&nbsp;</p>

The issue is more prominent when using the new 'codesnippet' plugin. Reproduction path:

  1. clone ckeditor 4.4.1
  2. add the textselection plugin
  3. enable the textselection and codesnippet plugin in samples/replacebycode.html (configuration: { extraPlugins: 'textselection,codesnippet' } )
  4. clear all text in the editor
  5. add a code snippet with the text 'foo'
  6. switch to source mode

Expected: the source is:

<pre>
<code>foo</code></pre>

Actual: the source is:

<p>&nbsp;</p>

<pre>
<code>foo</code></pre>

<p>&nbsp;</p>

<p>&nbsp;</p>
mdenburger commented 10 years ago

The first reproduction path has indeed been fixed in e3d95ca. However, the second reproduction path (with the codesnippet) still occurs.