Sanitize helper for Resource fields that may contain permitted HTML tags
For now, this just applies to the long_description
field on Resource...
A helper method that sanitizes a given string such that only approved HTML tags are included is needed. The approved HTML elements as of now are:
- p
- a
- strong
- em
- br
And approved HTML attributes are:
- href
This helper method should be applied to selected attributes (currently only long_description
) whenever they are saved - this includes during DOOR Import (so in the ProtoResource) and during normal CRUD in the UI.
https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize
Edited by Mike Kanning