Skip to content

Commit

Permalink
escape html for text and content vars in MarkdownRenderTruncate
Browse files Browse the repository at this point in the history
  • Loading branch information
hefowe committed Feb 7, 2017
1 parent 6069193 commit cee02da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/helpers/application_helper.rb
Expand Up @@ -5,11 +5,11 @@
# except paragraphs
class MarkdownRenderTruncate < Redcarpet::Render::Base
def paragraph(text)
text + ' '
CGI::escapeHTML(text) + ' '
end

def link(link, title, content)
content
CGI::escapeHTML(content)
end
end

Expand Down Expand Up @@ -50,7 +50,7 @@ def markdown(text, truncatable = false)
autolink: true,
superscript: true,
disable_indented_code_blocks: true
}).render(strip_tags(text)).html_safe
}).render(text).html_safe
end

def dropdown_items
Expand Down

0 comments on commit cee02da

Please sign in to comment.