Merge pull request #3131 from AndrewKvalheim/nofollow

Set `nofollow` on user-generated links
This commit is contained in:
Henne Vogelsang 2023-04-19 13:19:34 +02:00 committed by GitHub
commit 8b909a95c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -202,7 +202,7 @@ module FormatHelper
safe_links_only: true
}
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(render_options), markdown_options)
sanitize(markdown.render(text))
sanitize(sanitize(markdown.render(text)), scrubber: Loofah::Scrubbers::NoFollow.new)
end
def markdown_hint(text='')