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 breaks in a Rich Text field (redactor full) whenever quotes are used or links add

Development and Programming

pelluche's avatar
pelluche
38 posts
2 years ago
pelluche's avatar pelluche

I have a basic rich text field that spits out the content just fine most of the time, however if I go into HTML code for that rich text field and add like class=”mb-5” to an element it seems to prevent any other text after that from showing up.

This also happens if i highlight text and make an anchor link, it will spit out that field all the way up to where the quotes are and nothing else will show. It’s not escaping the characters properly apparently. (meaning once it gets to the href=”” it breaks). Is this a known issue or just on my end? Is there a specific paramater i can use to allow those type of characters?

I’m using EE 7.2.17

       
pelluche's avatar
pelluche
38 posts
2 years ago
pelluche's avatar pelluche

if I edit the rich text content after i save it and go into code view and change the quotes to single quote like href=”, then all the content will show properly. However, as soon as you go back and edit that field again the rich text changes it back to “” automatically which breaks it again.

       
pelluche's avatar
pelluche
38 posts
2 years ago
pelluche's avatar pelluche

yes, if i go into code view and change to single quotes and save.. the content will display properly. however, as soon as I go and edit that entire page full of widgets, anything in rich text (from within a grid field) will be back to “”.

this happens on a simple href=”/some-page”…. when using redactor full rich text(which may be the culrprit), as soon as i edit the page that has rich text and save again the content breaks. when i look at what devtools is spitting out for markup it seems to change a simple href=”/some-page” to href=”</div”>

       
Tom Jaeger's avatar
Tom Jaeger
449 posts
2 years ago
Tom Jaeger's avatar Tom Jaeger

Hi Pelluche,

Are you still running into this issue? If so, as a first course of action I would recommend upgrading to EE 7.3.5.. If it’s still happening, it would be great to have a simple text example we can test with locally.

Thanks,

-Tom Jaeger

       
pelluche's avatar
pelluche
38 posts
2 years ago
pelluche's avatar pelluche

Yes it’s still happening. I just updated to 7.3.6. Here’s a rundown of my setup. - I have a “generic_content” grid field, that has a Rich Text Editor field using Redactor Full - I have a “page_widgets” fluid field - Each page entry uses the “page_widgets” with list of all grid fields basically. If i add “generic_content” and write some text and create a typical anchor link, it will break the page if it’s got double quotes for the href=”“. If I go and edit that page entry at all and edit anything on page and click save, it will break page once it reaches that widget. I have to change any href to single href=” in order to fix it.

       
Robin Sowell's avatar
Robin Sowell
13,255 posts
2 years ago
Robin Sowell's avatar Robin Sowell

Odd, I’m not replicating.

Can you do this- view source on one that’s breaking, copy it, make a new entry, paste that in. Do you still have the problem? If so, can you paste it to a text file and attach here, so I can use it to replicate.

Also- I’m fuzzy on where it breaks. Is this after you click out of ‘view source’ in the cp and are looking at your textarea field and it’s not showing up there unless you’re in source mode? Or is it on the frontned? I tested both, both seemed to work. But want to make sure I’m looking at the right thing.

Oh- and I tested on just a plain, standalone rte field, not in grid/fluid/etc. Do you have the problem in a standalone field or only if it’s in grid/fluid?

       
pelluche's avatar
pelluche
38 posts
2 years ago
pelluche's avatar pelluche

It’s breaking on the frontend. All the content is still in the cms editor… but on frontend the page stops once it reaches a widget with an anchor link in the rich text. Nothing after that will last on frontend.

       
Robin Sowell's avatar
Robin Sowell
13,255 posts
2 years ago
Robin Sowell's avatar Robin Sowell

Does it break the same way in a standalone RTE field? Because mine isn’t breaking. Granted, I’m on the latest and I do recommend updating, but I don’t believe there have been recent changes.

       
pelluche's avatar
pelluche
38 posts
2 years ago
pelluche's avatar pelluche

This is apparently due to passing this rich text field as an embed variable to a partial file that renders the html for that widget. Depending if i wrap it around a single quote or double quote in the embed line, that’s when it breaks once it encounters same character in the rich text content. (Meaning if it encounters href=”” or a word like “that’s”). Is there a way to pass these safely to the partial template?

  • description=’{content:description}’
  • description=”{content:description}”
       
Benjaminnn's avatar
Benjaminnn
2 posts
one year ago
Benjaminnn's avatar Benjaminnn

@Drift Boss If your project allows, consider using a templating engine like Twig or Smarty. These engines often have built-in escaping mechanisms and can help handle complex templating scenarios.

       

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.