title: Split text in two paragraphs with twig
body: <p>I have rich text generated with Twig. The text is divided into two paragraphs.
  How do I create a read more function/button where the first paragraph is displayed and the second will be visible on a button click?</p>
  
  <p>I thought something like this:</p>
  
  <pre><code>  {% set paragraphs = content | split('&lt;/p&gt;') %}
  {% set firstParagraph = paragraphs | first ~ '&lt;/p&gt;' %}
  {% set secondParagraph = paragraphs[:2] ~ '&lt;/p&gt;' %}
            &lt;div class="accordion-group"&gt;
          &lt;div class="accordion-heading"&gt;
            &lt;a class="accordion-toggle custom-title" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo"&gt;&lt;/a&gt;
            &lt;p&gt;{{ firstParagraph | raw }}&lt;/p&gt;
          &lt;/div&gt;
          &lt;div id="collapseTwo" class="accordion-body collapse"&gt;
            &lt;div class="accordion-inner"&gt;
              &lt;p&gt;{{ secondParagraph | raw }}&lt;/p&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;script type="text/javascript"&gt;
  
            $(document).ready(function(){
              $('.SeeMore2').click(function(){
                var $this = $(this);
                $this.toggleClass('SeeMore2');
                if($this.hasClass('SeeMore2')){
                  $this.text('{{ 'Read more' | t }}');      
                } else {
                  $this.text('{{ 'Read less' | t }}');
                }
              });
            });
          &lt;/script&gt;
          &lt;a class="SeeMore2" data-toggle="collapse" href="#collapseTwo"&gt;{{ 'Read more' | t }}&lt;/a&gt;
  </code></pre>
  
  <p>The problem is that the second paragraph returns <code>array</code> as response. </p>