1

I'm using the plugin Redactor Extras https://github.com/elliotlewis/Redactor-Extras as I need be able to insert IDs to then anchor link to them.

However I'm finding the plugin adds the IDs as it should but on save they get stripped out. Oddly this plugin also allows you to add Classes which seems to be working but is still a bit temperamental.

Are there any settings I could try for Redactor to stop it doing this?

  • 1
    Have you tried turning off the "Purify HTML?" setting for your Rich Text field? – Mats Mikkel Rummelhoff Sep 6 '16 at 8:44
  • That does work! Although the warning puts me off doing this as a long term solution. I guess if there's no other way. – sarah3585 Sep 6 '16 at 8:56
  • Excellent. I'll add a real answer. – Mats Mikkel Rummelhoff Sep 6 '16 at 9:03
3

To prevent Rich Text fields from stripping your ID attributes, you'll need to disable the "Purify HTML?" setting for your field.

Note that disabling the HTML purifier does represent a potential security risk, but as long as you trust your content editor(s), you should be fine.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.