<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -44,6 +44,7 @@ $twig_filters = array(
     'translate_plural' =&gt; 'twig_translate_plural_string_filter',
     'normalize' =&gt;        'normalize',
     'truncate' =&gt;         'twig_truncate_filter',
+    'excerpt' =&gt;          'twig_excerpt_filter',
     'replace' =&gt;          'twig_replace_filter',
     'match' =&gt;            'twig_match_filter',
     'contains' =&gt;         'substr_count',
@@ -465,6 +466,14 @@ function twig_truncate_filter($text, $length = 100, $ending = &quot;...&quot;, $exact = fa
     return truncate($text, $length, $ending, $exact, $html);
 }
 
+function twig_excerpt_filter($text, $length = 200, $ending = &quot;...&quot;, $exact = false) {
+    $paragraphs = preg_split(&quot;/(\r?\n\r?\n|\r\r)/&quot;, $text);
+    if (count($paragraphs) &gt; 1)
+        return $paragraphs[0];
+    else
+        return truncate($text, $length, $ending, $exact, $html);
+}
+
 function twig_sort_filter($array) {
     asort($array);
     return $array;</diff>
      <filename>includes/class/Twig/runtime.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>eaaa8a2f9fadb2aca1bba34480742f1a0922a4b8</id>
    </parent>
  </parents>
  <author>
    <name>Alex Suraci</name>
    <email>i.am@toogeneric.com</email>
  </author>
  <url>http://github.com/vito/chyrp/commit/1deb6b08aaa1c0dd138c95474ef9c4e6112b6385</url>
  <id>1deb6b08aaa1c0dd138c95474ef9c4e6112b6385</id>
  <committed-date>2009-07-06T10:50:21-07:00</committed-date>
  <authored-date>2009-07-06T10:50:21-07:00</authored-date>
  <message>Added 'excerpt' Twig filter. Takes either the first paragraph or truncates the text to the given length if it's just a big blob.</message>
  <tree>ffb791d6874afbbba11c6ddbe330846d68c454a3</tree>
  <committer>
    <name>Alex Suraci</name>
    <email>i.am@toogeneric.com</email>
  </committer>
</commit>
