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?

3
  • 1
    Have you tried turning off the "Purify HTML?" setting for your Rich Text field? Commented Sep 6, 2016 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
    Commented Sep 6, 2016 at 8:56
  • Excellent. I'll add a real answer. Commented Sep 6, 2016 at 9:03

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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