Skip to content

Commit

Permalink
use html_safe in format helper
Browse files Browse the repository at this point in the history
  • Loading branch information
cycomachead committed Jul 20, 2023
1 parent 24a658f commit 9a0ea9f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/helpers/format_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ def markdown(text, escape_html = true)
safe_links_only: true
}
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(render_options), markdown_options)
escape_html ? sanitize(markdown.render(text)) : markdown.render(text)
escape_html ? sanitize(markdown.render(text)) : markdown.render(text).html_safe
end

def markdown_hint(text = '')
markdown(
"#{text} Please look at #{link_to '**Markdown Syntax**', 'https://daringfireball.net/projects/markdown/syntax',
target: '_blank', rel: 'noopener'} to format your text", false
)
link = link_to('**Markdown Syntax**',
'https://daringfireball.net/projects/markdown/syntax',
target: '_blank', rel: 'noopener')
markdown("#{text} Please look at #{link} to format your text", false)
end

# Return a plain text markdown stripped of formatting.
Expand Down

0 comments on commit 9a0ea9f

Please sign in to comment.