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 when codesnippet plugin is active #9

Closed mdenburger closed 9 years ago

mdenburger commented 10 years ago

The textselection plugin adds empty paragraphs when switching from normal view to source view after a code snippet has been added. The fix for #5 only fixed the case when the editing area is empty.

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>
w8tcha commented 10 years ago

Looks like even without the textselection plugin the content is wrong

after switching to source

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

<p>&nbsp;</p>
w8tcha commented 9 years ago

issue should be fixed with latest version