mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
fix mentions in code blocks
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user