Hi all,

I can't find a clear instruction on how to allow more elements then there are by default.
When I try to use the elements 'figure' and 'figcaption', they get stripped.

Trying to allow them via the config-page, gives me this error:

User warning: Element 'figcaption' is not supported (for information on implementing this, see the support forums) in HTMLPurifier_HTMLDefinition->setupConfigStuff() (regel 311 van /domain.com/sites/all/libraries/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php).

I've tried reading this documentation, but I can't really figure out what code I should use and were to put it.

Can somebody help me out, please?

Thanks!

Comments

BigEd’s picture

6 months later and no one has responded to this question which seems to be quite an obvious one and should be part of the documentation.

I will offer some help although I have limited experience in using this module, really the maintainers may be able to offer better advice to this.

a[href|title|target|title],em,strong,cite,blockquote,code,ul,ol,li,dl,dt,dd,*[style]

*[style] is a wildcard

If you are adding more attributes to say to an item you may need to join them together in an example.
a[href|title|target|title]
or
img[title|alt|src]

Hope that helps.

It would be ideal to have a list of common items that can be copied and pasted that cover 90% of situations.

dmsmidt’s picture

I'm surprised this hasn't been answered fully.

Take a look at: hook_htmlpurifier_html_definition_alter().

scotwith1t’s picture

Worth noting that this is only available in the 2.x version, which currently only has a -dev version.