From 77178ca595dcad14ed8974073aa897fe60754f88 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Wed, 8 May 2019 14:46:57 +0100 Subject: [PATCH] Add href and target attributes to product serializer sanitizer to allow links with target in product descriptions --- app/serializers/api/product_serializer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/serializers/api/product_serializer.rb b/app/serializers/api/product_serializer.rb index 0ee2d5724b..dfb82cedf6 100644 --- a/app/serializers/api/product_serializer.rb +++ b/app/serializers/api/product_serializer.rb @@ -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