Score:0

Why does the Full HTML text format convert special characters to HTML entities?

ye flag

I am trying to create a block with plain text HTML in Source mode of CKEditor.

The HTML should be 100% the HTML that I myself write. Drupal shouldn't modify this HTML or add HTML to it.

When the block's text format is set to "Full HTML" and edited in Source mode, Drupal keeps changing this:

<p style="color: #fff; font-size: 36px;">טקסט<br>
טקסט<br>
text</p><br>

To this:

<p style="color: #fff; font-size: 36px&gt;טקסט&lt;br /&gt;
טקסט&lt;br /&gt;
textlt;/h2&gt;&lt;br&gt;

This Drupal-made Source output is confusing to me, I can't work with it.

Why is this happening and how to prevent Drupal from modifying the actual HTML that I've wrote?

I have tried to go to /admin/config/content/formats and there add Plain text as a CKEditor text format but I can't. There is a message there:

This format is shown when no other formats are available

Full HTML filters that are on

In /admin/config/content/formats/manage/full_html?destination=/admin/config/content/formats the only filters that are on are:

  • Align images
  • Caption images
  • Correct faulty and chopped off HTML
  • Track images uploaded via a text editor
cn flag
Are you pasting HTML tags directly into CKEditor? If so, you need to be in Source mode (click the Source icon).
somo avatar
ye flag
I write the HTML (and regular English text) inside Source mode, yet after saving and checking the Source mode again, it appear changed, as I have shown.
somo avatar
ye flag
I have edited to clarify.
id flag
Which filters are on the “Full HTML” text format? Is CKEditor enabled on the “Full HTML” text format? Have you read any documentation about Drupal text formats?
somo avatar
ye flag
@cilefen yes, I have updated to describe the filters that are on. Yes. I have read some of them some time ago. In 13 years of Drupal I don't recall a similar issue.
id flag
Have you tried disabling “Correct faulty and chopped off HTML”?
somo avatar
ye flag
@cilefen I have tried it now. I have tested new HTML which I have pasted. In two HTML tests the HTML wasn't changed. Indeed I think that that was the problem. I am quite surprised some in the Drupal community didn't count on user's knowledge of HTML. I think such a mechanism, at least when on by default, outweighs the benefit.
Score:0
id flag

This is a well-known behavior of the “Correct faulty and chopped off HTML” filter for many years. You must disable filters if you want no filtering.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.