Skip to content

Commit 7d6b358

Browse files
authored
Merge pull request #249 from publify/strip-tags-permalinks
Remove html tags the Rails way when generating permalinks
2 parents 20ad297 + b629fa5 commit 7d6b358

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/publify_core/string_ext.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def to_permalink
1818
string = string.tr(key.join, value)
1919
end
2020
string = string.tr("'", "-")
21-
string.gsub(/<[^>]*>/, "").to_url
21+
Rails::HTML5::FullSanitizer.new.sanitize(string).to_url
2222
end
2323

2424
# Returns a-string-with-dashes when passed 'a string with dashes'.

0 commit comments

Comments
 (0)