protected function prepareHTMLChunk(&$html_source)
  { 
    // WARNING:
    // When modifying, test thhe following regexes on a huge page for preg_replace segfaults.
    // Be sure to set the preg-groups to "non-capture" (?:...)!
    
    // Replace <script>-sections from source, but only those without src in it.
    if ($this->ignore_document_sections & PHPCrawlerLinkSearchDocumentSections::SCRIPT_SECTIONS)
    {
      $html_source = preg_replace("#<script(?:(?!src).)*>.*(?:<\/script>|$)# Uis", "", $html_source);
      $html_source = preg_replace("#^(?:(?!<script).)*<\/script># Uis", "", $html_source);
    }
    
    // Replace HTML-comments from source
    if ($this->ignore_document_sections & PHPCrawlerLinkSearchDocumentSections::HTML_COMMENT_SECTIONS)
    {
      $html_source = preg_replace("#<\!--.*(?:-->|$)# Uis", "", $html_source);
      $html_source = preg_replace("#^(?:(?!<\!--).)*--># Uis", "", $html_source);
    }
    
    // Replace javascript-triggering attributes
    if ($this->ignore_document_sections & PHPCrawlerLinkSearchDocumentSections::JS_TRIGGERING_SECTIONS)
    {
      $html_source = preg_replace("#on[a-z]+\s*=\s*(?|\"([^\"]+)\"|'([^']+)'|([^\s><'\"]+))# Uis", "", $html_source);
    }
  }