title: line break and paragraph has doubled itself every time I save the document ckeditor adding extra spaces paragraph and line breaks after every saving
body: <p>Hi I have implemented the ckeditor in my asp.net and vb.net web application.  After a lot of struggle its working fine. </p>
  
  <p>But its adding a lots of line breaks and paragraphs (specially copying and pasting from word file ) after every save. The editor is placing extra <code>&lt;br/&gt;</code> in side the html after submission of the page. </p>
  
  <p>If there is one line break its adding 4 line breaks.  if I submit</p>
  
  <pre><code>xxx&lt;br&gt;yyy 
  </code></pre>
  
  <p>after submission it is becoming</p>
  
  <pre><code>xxx&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&lt;br/&gt;&lt;br/&gt;yyy
  </code></pre>
  
  <p>To clarify when copying and pasting for the first time we do NOT see this behaviour, the problem is only seen on subsequent edits/saves.</p>
  
  <p>Please advice me how i can handle that. So that it does not adds extra line breaks and paragraph after saving the form.</p>
  
  <p>Here are the steps which I have followed to implement ckeditor.</p>
  
  <p><strong>1.</strong> Downloaded the ckeditor from the link <a href="http://ckeditor.com/download" rel="nofollow noreferrer">http://ckeditor.com/download</a>. I am using the full package</p>
  
  <p><strong>2.</strong> Copied the whole folder under project folder.</p>
  
  <p><strong>3.</strong> In the master page added the following lines to add reference of ckeditor</p>
  
  <pre><code>   &lt;script src="/ckeditor/ckeditor.js" type="text/javascript"&gt;&lt;/script&gt;
     &lt;script src="/ckeditor/adapters/jquery.js" type="text/javascript"&gt;&lt;/script&gt;
     &lt;script src="/ckeditor/ckeditor_custom.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p><strong>4.</strong> Changed the class for the specific textarea</p>
  
  <pre><code>&lt;textarea runat="server" id="txtDescription" name="txtDescription" class="ckeditor" style="width: 98%; height: 250px;"&gt;&lt;/textarea&gt;
  </code></pre>
  
  <p><strong>5.</strong> Added following javascript function at the bottom of the content page</p>
  
  <pre><code>$('#' + '&lt;%= btnSave.ClientID%&gt;').mousedown(function () {
      for (var i in CKEDITOR.instances) {
          CKEDITOR.instances[i].updateElement();
      }
  });
  </code></pre>
  
  <p>Thats it. nothing has changed in the code file</p>
  
  <p>here the btn.save is the button which submits the data</p>
  
  <p>To describe the problem clearly I am providing the case situation below.</p>
  
  <p>Suppose I want to copy padte the follwing text from a word file.</p>
  
  <p>Working Log
  •   1st Week : Introduction
  o   Discovered the location of the website
  o   Started familiarise with the websites and portal.</p>
  
  <p>After pasting it into ck editor the html source of this is like following</p>
  
  <pre><code>&lt;p&gt;&lt;strong&gt;Working Log&lt;/strong&gt;&lt;/p&gt;
  &lt;ol style="list-style-type:lower-roman"&gt;
     &lt;li&gt;1&lt;sup&gt;st&lt;/sup&gt; Week : Introduction
      &lt;ul style="list-style-type:circle"&gt;
          &lt;li&gt;Discovered the location of the website&lt;/li&gt;
          &lt;li&gt;Started familiarise with the websites and portal.&lt;/li&gt;
      &lt;/ul&gt;
     &lt;/li&gt;
  &lt;/ol&gt;
  </code></pre>
  
  <p>But when I save the form and open it again the source code becomes like this</p>
  
  <pre><code>        &lt;p&gt;&lt;strong&gt;Working Log&lt;/strong&gt;&lt;/p&gt;
      &lt;p&gt;&amp;nbsp;&lt;/p&gt;
      &lt;p&gt;&amp;nbsp;&lt;/p&gt;
      &lt;ol style="list-style-type:lower-roman"&gt;&lt;br /&gt;
          &lt;li&gt;1&lt;sup&gt;st&lt;/sup&gt; Week : Introduction&lt;br /&gt;
            &amp;nbsp;
          &lt;ul style="list-style-type:circle"&gt;&lt;br /&gt;
              &lt;li&gt;Discovered the location of the website&lt;/li&gt;
              &lt;br /&gt;
              &lt;li&gt;Started familiarise with the websites and portal.&lt;/li&gt;
             &lt;br /&gt;
             &lt;br /&gt;
             &amp;nbsp;
          &lt;/ul&gt;
          &lt;/li&gt;
             &lt;br /&gt;
           &lt;br /&gt;
          &amp;nbsp;
           &lt;/ol&gt;
          &lt;p&gt;&amp;nbsp;&lt;/p&gt;
          &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  </code></pre>
  
  <p>And the line break and paragraphs doubles and triples after each submission of the form.</p>
  
  <p>Driving me mad. Please help how can i handle the situation.</p>
  
  <p><strong>-----------------</strong> Why My problem is different from the question asked in this link <a href="https://stackoverflow.com/questions/2547090/removing-unwanted-newline-characters-when-adding-p-in-ckeditor">Removing unwanted newline characters when adding &lt;p&gt; in CKEditor</a> 
  <strong>-----------------</strong></p>
  
  <p>The question asked in that link does not explain all the detail. in my question i have explained clearly when I can see this problem. the person asked the question in the above mentioned link if he has copied and text from a word document or has he used html tags to format the text in the editor. I have mentioned every detail so that it becomes easy for the people who will answer the question.</p>
  
  <p>The problems was also different. The problem in the mentioned link was only concerned with the  <code>&lt;p&gt;</code> replaced by indent. Whereas in <strong>my case every line break <code>&lt;br&gt;</code> and paragraph <code>&lt;p&gt;</code> has doubled itself every time I save the document . I was copying text from word document and mentioned it in my question. I did not find any detail in the question in above mentioned link.</strong> </p>
  
  <p>Situations are different for different coder. the person asked that question did not explain what is his coding environment. I have implemented CKEditor in Vb.Net and ASP.net based web app and I mentioned that in my question. I also mentioned every steps how I have installed the editor in the app. But the person who asked the question in the link did not included any details. Also trying the solution given in his question did not solve my problem. So I included all the details in my question. And my solution is also different.</p>
  
  <p><strong>The answer given in the mentioned link did not solve my problem. i had to set every rules as false to get rid of the problem. Whereas in the answer of the above mentioned link two of the rules were set as True. 
  Also the function <code>CKEDITOR.editorConfig = function (config) {</code> was not mentioned in the answer to the question mentioned in the link.  Hence the question given on that link was not helpful for me.</strong> </p>