Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Crawler.php

function Crawler::parseHtmlString

Parse string into DOMDocument object using HTML5 parser if the content is HTML5 and the library is available. Use libxml parser otherwise.

1 call to Crawler::parseHtmlString()
Crawler::addHtmlContent in vendor/symfony/dom-crawler/Crawler.php
Adds an HTML content to the list of nodes.

File

vendor/symfony/dom-crawler/Crawler.php, line 1204

Class

Crawler
Crawler eases navigation of a list of \DOMNode objects.

Namespace

Symfony\Component\DomCrawler

Code

private function parseHtmlString(string $content, string $charset) : \DOMDocument {
    if ($this->canParseHtml5String($content)) {
        return $this->parseHtml5($content, $charset);
    }
    return $this->parseXhtml($content, $charset);
}
RSS feed
Powered by Drupal