Permalink
Browse files

Fix some minor spacing issues in previews

  • Loading branch information...
1 parent c9026f8 commit 685c80e4c748ddbb5f729be9f8722a9f9718321e @Squeegy Squeegy committed Aug 15, 2008
Showing with 2 additions and 0 deletions.
  1. +2 −0 app/models/post.rb
View
@@ -72,6 +72,8 @@ def initialize(xml, options = {})
# Prepare preview
@preview = @body.dup
@preview.gsub!('
', ' ') # remove line break entities
+ @preview.gsub!(/<br.*?>/, ' ') # remove <br />'s
+ @preview.gsub!(/\s+/, ' ') # remove consecutive spaces
@preview.gsub!(/<span class="jt_spoiler".+?<\/span>/, '______') # remove spoilers
@preview.gsub!(/<.+?>/, '') # strip all html tags
@preview = @preview[0..150] # truncate to 150 character max

0 comments on commit 685c80e

Please sign in to comment.