0
votes

I have a problem with html in CKEditor. I've pasted code:

<ul>
  <li>Hello1</li>
  <ul>
     <li>Hello2</li>
     <li>Hello3</li>
     <li>Hello4</li>
  </ul>
</ul>

After that I've saved code-and it's works fine. But when I've tried to change code again-source code in CKEditor is:

<ul>
  <li>Hello1
    <ul>
       <li>Hello2</li>
       <li>Hello3</li>
       <li>Hello4</li>
    </ul>
  </li>
</ul>

Why? Is it possible to tune this in config.js? Thanks

1
This is because the HTML in your first example is invalid, you cannot nest an unordered list directly within another unordered like that. CKEditor is attempting to "fix" your error for you. - Shaggy
possible duplicate of CKEditor: Keep source indentation - Reinmar
Yes,it's duplicate...My apologies for a spam question.Shaggy and Reinmar thank you! - Renat

1 Answers

1
votes

Your input source code is invalid - ul cannot contain a ul and CKEditor must work with a valid HTML. Read more CKEditor HTML Autocorrection Issue.