Skip to content

Commit 7fd4031

Browse files
committed
feat: Add 'div' tag and 'style' attribute to allowed HTML in sanitize_block_html
1 parent aec2a38 commit 7fd4031

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/helpers/better_together/content/blocks_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def temp_id_for(model, temp_id: SecureRandom.uuid)
1717
# Sanitize HTML content for safe rendering in custom blocks
1818
def sanitize_block_html(html)
1919
allowed_tags = %w[p br strong em b i ul ol li a span h1 h2 h3 h4 h5 h6 img figure figcaption blockquote pre
20-
code iframe]
21-
allowed_attrs = %w[href src alt title class target rel]
20+
code iframe div]
21+
allowed_attrs = %w[href src alt style title class target rel]
2222
sanitize(html.to_s, tags: allowed_tags, attributes: allowed_attrs)
2323
end
2424

0 commit comments

Comments
 (0)