0

Here is my model:

class Page(models.Model):
    title      = models.CharField(max_length=70)
    slug       = models.SlugField()
    priority   = models.IntegerField()
    body       = RichTextUploadingField()
    author     = models.ForeignKey(User, on_delete=models.CASCADE)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
    status     = models.CharField(max_length=10, choices=STATUS_CHOICES, default='published'

The problem is when I save the record, some of the HTML elements are escaped. For example,I cannot save <I class="icofont-check-circled"></i>. Could you help me

Rustam
  • 273
  • 4
  • 18

1 Answers1

0

I found the answer. The problem was not about escaping in Django framework but on CKEditor configuration. I just added config.protectedSource.push(/<i[^>]*><\/i>/g);to CKEditor config file. It solved my issue.

The complete answer is here: CKEditor strips <i> Tag

Rustam
  • 273
  • 4
  • 18