Open toffehoff opened 3 months ago
@toffehoff, it looks like the description field still contains<p>
tags because they were not stripped out during backend ingestion. We can address this.
Deployed to Staging and (as a hotfix) to Prod.
Let's search for a nicer solution, prohibiting TextField usage for TinyMCE.
A suggested one:
Let's update the tinyMCE default config to use
"selector": "textarea.rich-textarea",
And do
widgets = {
"description": forms.Textarea(attrs={"class": "rich-textarea"}),
}
(Or model-wise if possible, let's link it to HTMLFields by default.)
There are 11 places to insert this:
grep HTMLF $(find . -name "models.py" 2>/dev/null)|grep -v import
./deployments/models.py: description = HTMLField(verbose_name=_("description"), blank=True, default="")
./per/models.py: description = HTMLField(verbose_name=_("description"), null=True, blank=True)
./flash_update/models.py: situational_overview = HTMLField(verbose_name=_("Situational Overview"), blank=True, default="")
./api/models.py: snippet = HTMLField(verbose_name=_("snippet"), null=True, blank=True)
./api/models.py: snippet = HTMLField(verbose_name=_("snippet"), null=True, blank=True)
./api/models.py: snippet = HTMLField(verbose_name=_("snippet"), null=True, blank=True)
./api/models.py: snippet = HTMLField(verbose_name=_("snippet"), null=True, blank=True)
./api/models.py: snippet = HTMLField(verbose_name=_("snippet"), null=True, blank=True)
./api/models.py: summary = HTMLField(verbose_name=_("summary"), blank=True, default="")
./api/models.py: snippet = HTMLField(verbose_name=_("snippet"), null=True, blank=True)
./api/models.py: description = HTMLField(verbose_name=_("description"), blank=True, default="")
Deployed to Staging and (as a hotfix) to Prod.
Is the hotfix only for "featured documents"? is it possible to roll it out to "links" as well? I can see that "links" section of the Mpox GO page has the html markings: https://go.ifrc.org/emergencies/7118/details
Oh, true. Let me check that "links" section.
@nanometrenat fixed the field on admin (Staging and Prod), also the erroneous texts in database. :-)
Issue
An operation can have "Featured Documents". In the short explanation section under the document title, the Paragraph HTML codes are shown (which are not shown in the edit section in the backend).
Steps to reproduce
Go to the Ukraine Operation Reports page (https://go.ifrc.org/emergencies/5854/reports). There you see this:
Expected behaviour
The
<p>
and</p>
html codes should not be shownRelated feature
Maybe linked to issues related to a rich-text editor in the back-end.
Impact
This is visible for everyone.
Severity
Minor, since it is a cosmetic issue.
Is there a workaround?
Not tested.