Skip to content

Commit

Permalink
Fix some minor spacing issues in previews
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexJWayne committed Aug 15, 2008
1 parent c9026f8 commit 685c80e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/post.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def initialize(xml, options = {})
# Prepare preview # Prepare preview
@preview = @body.dup @preview = @body.dup
@preview.gsub!('
', ' ') # remove line break entities @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!(/<span class="jt_spoiler".+?<\/span>/, '______') # remove spoilers
@preview.gsub!(/<.+?>/, '') # strip all html tags @preview.gsub!(/<.+?>/, '') # strip all html tags
@preview = @preview[0..150] # truncate to 150 character max @preview = @preview[0..150] # truncate to 150 character max
Expand Down

0 comments on commit 685c80e

Please sign in to comment.