コード例 #1
0
     // skip this and move to next item
     if (!$valid_key) {
         $html = $options->error_message;
     } else {
         $html = $options->error_message_with_key;
     }
     // keep the original item description
     $html .= $item->get_description();
 } else {
     $readability->clean($content_block, 'select');
     if ($options->rewrite_relative_urls) {
         makeAbsolute($effective_url, $content_block);
     }
     // footnotes
     if ($links == 'footnotes' && strpos($effective_url, 'wikipedia.org') === false) {
         $readability->addFootnotes($content_block);
     }
     if ($extract_pattern) {
         // get outerHTML
         $html = $content_block->ownerDocument->saveXML($content_block);
     } else {
         if ($content_block->childNodes->length == 1 && $content_block->firstChild->nodeType === XML_ELEMENT_NODE) {
             $html = $content_block->firstChild->innerHTML;
         } else {
             $html = $content_block->innerHTML;
         }
     }
     // post-processing cleanup
     $html = preg_replace('!<p>[\\s\\h\\v]*</p>!u', '', $html);
     if ($links == 'remove') {
         $html = preg_replace('!</?a[^>]*>!', '', $html);