fix mentions in code blocks

This commit is contained in:
Ryan Boland
2013-07-30 18:01:42 -04:00
parent 028cd348e1
commit 553a671fdb
2 changed files with 8 additions and 0 deletions

View File

@@ -51,6 +51,9 @@ class PostAnalyzer
return @raw_mentions if @raw_mentions.present?
raw_stripped = @raw.gsub(/\[quote=(.*)\]([^\[]*?)\[\/quote\]/im, '')
# Process markdown so that code blocks can be generated and subsequently ignored
raw_stripped = PrettyText.markdown(raw_stripped)
# Strip pre and code tags
doc = Nokogiri::HTML.fragment(raw_stripped)
doc.search("pre").remove