2

How to remove unclosed tags(e.g. ) in ckeditor? When I put any unclosed tag within a tag, its closed automatically before closing parent tag. e.g. below my code before render

<div>
  <strong>Test unclosed tag 
  <p>
    <span>Hey this is test content to check unclosed tag 
      <a href="google.com">Google</a>
    </span>
  </p
  ><span>Processing...</span>
</div>

But after saving content, render content looks like below code

<div>
 <strong>Test unclosed tag </strong>
   <p><strong><span>Hey this is test content to check unclosed tag 
     <a href="google.com">Google</a></span></strong>
   </p>
  <strong><span>Processing...</span></strong>
</div>

So what I want, if any unclosed tag are there, they should be stripped and remain the content of the tag as plain like below code

<div>
  Test unclosed tag 
  <p>
    <span>Hey this is test content to check unclosed tag 
      <a href="google.com">Google</a>
    </span>
  </p
  ><span>Processing...</span>
</div>

Note: I am using Drupal 7 with full html and filter html format in CK Editor.

Any help or suggestion is much appreciated.

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.