Closed DanB-Web closed 8 months ago
As an example, this is what is saved when I dump to a fixture:
"<p><span style=\"color:#ce9178;\">Yadda yadda yadda....</span></p>"
@DanB-Web I can't reproduce that, simply entering Yadda yadda yadda....
does not produce a span for me. Is there anything special you do to enter it?
Hi, apologies for the later reply.
No, nothing special, although I am using it within the Django admin area if that helps give context. I solved the issue for my use case by running the content through Beautiful Soup in a pre-save signal.
Sorry, switched from work account :-)
As an example, here is one of the fixtures from and earlier commit in my repo:
As you can see, description
, requirements
and role
in the jobs
model (the three fields using the WYSIWYG editor in the admin) all have the span around them.
The fields are on the Job model as below:
description = CKEditor5Field('Job description', config_name='extends', blank=False)
requirements = CKEditor5Field('Job requirements', config_name='extends', blank=False)
role = CKEditor5Field('Role details', config_name='extends', blank=False)
@DanB-Web Strange, when using the example blog application from this repo and entering any text, I see the following in the sqlite database:
sqlite> SELECT * from articles_article;
1|title|<p>test</p>|
So I can't reproduce it at all. Only guess is it's maybe something in your ckeditor config? As a side-note: we use Bleach to get rid of unwanted html tags as it's a good idea to filter user input anyway :)
Hi,
When saving content, it appears that the text within p-tags is also getting a surrounding span which is applying an inline style (a fontColor of
#ce9178
, in my case) - is it possible to remove this?I don't have this colour anywhere in my codebase so I'm assuming it must come from the library somewhere?