Remove duplication in TextWithLinksHelper
We were using `Rinku.auto_link` the same way twice. And it makes sense that the method `sanitize_and_auto_link` first sanitizes the text and then calls `auto_link_already_sanitized_text`.
This commit is contained in:
@@ -3,7 +3,7 @@ module TextWithLinksHelper
|
|||||||
def sanitize_and_auto_link(text)
|
def sanitize_and_auto_link(text)
|
||||||
return unless text
|
return unless text
|
||||||
sanitized = sanitize(text, tags: [], attributes: [])
|
sanitized = sanitize(text, tags: [], attributes: [])
|
||||||
Rinku.auto_link(sanitized, :all, 'target="_blank" rel="nofollow"').html_safe
|
auto_link_already_sanitized_html(sanitized)
|
||||||
end
|
end
|
||||||
|
|
||||||
def auto_link_already_sanitized_html(html)
|
def auto_link_already_sanitized_html(html)
|
||||||
|
|||||||
Reference in New Issue
Block a user