Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Line breaks not saved in descriptions fixed#2394 (#2803)
* Fix line breaks * modified test to check for line break in description * added a concern method for sanitize description
- Loading branch information
1 parent
952c510
commit 3da565f
Showing
4 changed files
with
20 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module SanitizeDescription | ||
extend ActiveSupport::Concern | ||
|
||
def sanitize_description(description) | ||
sanitize( | ||
description, | ||
tags: %w[img p strong em a sup sub del u span h1 h2 h3 h4 hr li ol ul blockquote br], | ||
attributes: %w[style src href alt title target] | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters