3

Is there a default.json file for the html purifier settings in Craft? Now we can configure this I want to extend to include the stripping on non-breaking spaces. However, I don't want to just extend my requirements and not replace the default.

As I understand I would create a new json file in craft/config/htmlpurifier and this file would contain the following;

{
  "AutoFormat.RemoveEmpty.RemoveNbsp": true,
}

Is this all that is required?

Terry Upton
  • 1,894
  • 10
  • 28

1 Answers1

2

Craft won't merge your HTML Purifier config settings with the default ones, but the default ones are pretty simple, so I'd just include them with yours.

{
    "AutoFormat.RemoveEmpty.RemoveNbsp": true,
    "Attr.AllowedFrameTargets": ["_blank"],
    "HTML.AllowedComments": ["pagebreak"]
}
Brad Bell
  • 67,440
  • 6
  • 73
  • 143
  • Would love to see this in the documentation somewhere. A search for Purifier doesn't return anyhing. – Jan_dh Oct 01 '19 at 06:49