strip links for first words

This commit is contained in:
Andreas Stephanides
2014-04-02 11:23:27 +02:00
parent 4ec176f310
commit 71dc435d13

View File

@@ -53,7 +53,7 @@ class Neuigkeit < ActiveRecord::Base
self.title
end
def text_first_words
md = /<p>(?<text>[\w\s,\.!\?]*)/.match self.text
md = /<p>(?<text>[\w\s,\.!\?]*)/.match strip_links(self.text)
words=md[:text].split(" ") unless md.nil?
if words.nil? || words.empty?
"...."