You are here

protected function FeedsExHtml::prepareDocument in Feeds extensible parsers 7

Same name and namespace in other branches
  1. 7.2 src/FeedsExHtml.inc \FeedsExHtml::prepareDocument()

Prepares the DOM document.

Parameters

FeedsSource $source: The feed source.

FeedsFetcherResult $fetcher_result: The fetcher result.

Return value

DOMDocument The DOM document.

Overrides FeedsExXml::prepareDocument

File

src/FeedsExHtml.inc, line 37
Contains FeedsExHtml.

Class

FeedsExHtml
Parses HTML documents with XPath.

Code

protected function prepareDocument(FeedsSource $source, FeedsFetcherResult $fetcher_result) {
  $raw = $this
    ->prepareRaw($fetcher_result);
  if ($this->config['use_tidy'] && extension_loaded('tidy')) {
    $raw = tidy_repair_string($raw, $this
      ->getTidyConfig(), 'utf8');
  }
  return FeedsExXmlUtility::createHtmlDocument($raw);
}