We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Text formatting bug?

Development and Programming

harsing's avatar
harsing
56 posts
7 years ago
harsing's avatar harsing

Hi, I have installed EE4 and I notice that when I create a text input or textarea field with text formatting set to “None”, html tags still get encoded. For example, opening and closing tags get encoded as < and > respectively. I understand that some sort of cleansing is being done before saving data to the database, but this should be converted back when outputting to the browser, no?

Regards, Matts

       
James Mathias's avatar
James Mathias
225 posts
7 years ago
James Mathias's avatar James Mathias

Hi,

If you want to preserve HTML tags I believe you need to set it to XHTML. None will not preserve HTML tags in it’s content.

       
harsing's avatar
harsing
56 posts
7 years ago
harsing's avatar harsing

Hi James, I tried this but the tags still get converted to character entities. The Rich Text Editor (RTE) also converts its html source to character entities which is really strange.

I forgot to mention that all fields are inside a fluid field. That might explain it. It seems that the {content} tag inside a fluid field surrounds the actual content with <p></p>.

For example if I add a text input to a fluid field and enter

<h3>Some heading text</h3>

in the text input field and then display it using the following template code:

{my_fluid_field}

{my_fluid_field:my_text_input}
  {content}
{/my_fluid_field:my_text_input}

{/my_fluid_field}

…EE actually outputs…

<p><h3>Some heading text</h3></p>

If I change the field formatting to markdown and enter…

#### Some heading text

…it seems to work. However it is not always convenient to use markdown…

Regards, Matts

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.