mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: do not show image as category description
This commit is contained in:
parent
f8aca6d530
commit
fa0f731427
1 changed files with 5 additions and 2 deletions
|
@ -393,11 +393,14 @@ class PostRevisor
|
|||
|
||||
body = @post.cooked
|
||||
matches = body.scan(/\<p\>(.*)\<\/p\>/)
|
||||
if matches && matches[0] && matches[0][0]
|
||||
new_description = matches[0][0]
|
||||
|
||||
matches.each do |match|
|
||||
next if match[0] =~ /\<img(.*)src=/ || match[0].blank?
|
||||
new_description = match[0]
|
||||
new_description = nil if new_description == I18n.t("category.replace_paragraph")
|
||||
category.update_column(:description, new_description)
|
||||
@category_changed = category
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue