Add href and target attributes to product serializer sanitizer to allow links with target in product descriptions

This commit is contained in:
luisramos0
2019-05-08 14:46:57 +01:00
parent 7790401d59
commit 77178ca595

View File

@@ -55,7 +55,7 @@ class Api::CachedProductSerializer < ActiveModel::Serializer
#return a sanitized html description
def description_html
d = sanitize(object.description, tags: "p, b, strong, em, i, a, u")
d = sanitize(object.description, tags: "p, b, strong, em, i, a, u", attributes: "href, target")
d.to_s.html_safe
end