This shows the 'next' link with custom html
@param string $html The HTML you wish to use to display the link
@return string The Same HTML replaced the tags with the proper number
500453
public function next($html, $html2 = '')
    {
        # Only show if you are not on the last page
        $r = ($this->get < $this->pages()) ? str_replace('{nr}', $this->get + 1, $html) : str_replace('{nr}', $this->get + 1, $html2);

        return $r;
    }
866838
public function convert($html)
    {
        preg_match_all('|<img ([^>]+)>|', $html, $matches);

        foreach($matches[0] as $img)
        {
            $crawler = new Crawler();
            $crawler->addContent($img);
            $imgTag = $crawler->filter("img");

            $src = $imgTag->attr('src');
            $width = $imgTag->attr('width');
            $height = $imgTag->attr('height');

            if (!empty($width) || !empty($height)) {
                $format = $width . "x" . $height;
                $updatedTagString = preg_replace("| src=[\"']" . $src . "[\"']|", " src=\"" . $this->imResize($src, $format) . "\"", $img);
                $html = str_replace($img, $updatedTagString, $html);
            }
        }

        return $html;
    }
196239
public function appendChildFromHtmlString($html)
    {
        $dom = new \DOMDocument;
        $dom->loadHTML($html);

        $element = simplexml_import_dom($dom);
        $element = current($element->xPath('//body/*'));

        $this->appendChildNode($element);
    }
381476
public function getNext($text = '&raquo;')
	{
		// If the current page is greater than or equal to the last page, it means we
		// can't go any further into the pages, as we're already on this last page
		// that is available, so we will make it the "next" link style disabled.
		if ($this->currentPage >= $this->lastPage)
		{
			return $this->getDisabledTextWrapper($text);
		}
		else
		{
			$url = $this->paginator->getUrl($this->currentPage + 1);

			return $this->getPageLinkWrapper($url, $text);
		}
	}
218713
public function parseHtml($html)
    {
        return Parser::table($html, '#DBGrid', [
            'status', 'name', 'credit', 'examination', 'property', 'teacher', 'code', 'week',
            ['hour', function (Crawler $crawler) {
                return $crawler->attr("title") ?: $crawler->text();
            }],
            ['place', function (Crawler $crawler) {
                return $crawler->text() == ";" ? '' : ($crawler->attr("title") ?: $crawler->text());
            }],
            'campus',
            ['class', function (Crawler $crawler) {
                return $crawler->attr("title") ?: $crawler->text();
            }],
        ], 12, 1, 'text');
    }
1276286
public function loadHTML($html)
    {
        $html = str_replace(chr(13), '', $html);
        $html = '<?xml version="1.0" encoding="utf-8" ?><' . $this->PARENT_TAG_NAME . '>' . $html . '</' . $this->PARENT_TAG_NAME . '>';
        if (defined('LIBXML_HTML_NODEFDTD')) {
            return $this->dom->loadHTML($html, LIBXML_HTML_NODEFDTD);
        } else {
            return $this->dom->loadHTML($html);
        }


    }
1238789
protected function decodeHtml($html): string
    {
        $text = html_entity_decode($html);
        $text = preg_replace('#<br\s*/?>#', LF, $text);

        return $text;
    }
490279
protected function parseHtml($html)
    {
        $data = [
            'image' => '',
            'title' => '',
            'description' => '',
            'pictures' => [],
        ];

        libxml_use_internal_errors(true);
        $doc = new \DOMDocument();
        $doc->loadHTML($html);

        /** @var \DOMElement $meta */
        foreach ($doc->getElementsByTagName('meta') as $meta) {
            if ($meta->getAttribute('itemprop') === 'image') {
                $data['image'] = $meta->getAttribute('content');
            } elseif ($meta->getAttribute('property') === 'og:image') {
                $data['image'] = $meta->getAttribute('content');
            } elseif ($meta->getAttribute('property') === 'twitter:image') {
                $data['image'] = $meta->getAttribute('value');
            }

            if ($meta->getAttribute('itemprop') === 'name') {
                $data['title'] = $meta->getAttribute('content');
            } elseif ($meta->getAttribute('property') === 'og:title') {
                $data['title'] = $meta->getAttribute('content');
            } elseif ($meta->getAttribute('property') === 'twitter:title') {
                $data['title'] = $meta->getAttribute('value');
            }

            if ($meta->getAttribute('itemprop') === 'description') {
                $data['title'] = $meta->getAttribute('content');
            }
            if ($meta->getAttribute('property') === 'og:description') {
                $data['description'] = $meta->getAttribute('content');
            }
        }

        if (empty($data['title'])) {
            /** @var \DOMElement $title */
            foreach ($doc->getElementsByTagName('title') as $title) {
                $data['title'] = $title->nodeValue;
            }
        }

        if (empty($data['description'])) {
            foreach ($doc->getElementsByTagName('meta') as $meta) {
                if ($meta->getAttribute('name') === 'description') {
                    $data['description'] = $meta->getAttribute('content');
                }
            }
        }

        foreach ($doc->getElementsByTagName('img') as $img) {
            $data['pictures'][] = $img->getAttribute('src');
        }

        return $data;
    }
216030
public static function htmlToDomDocument($html)
    {
        if (!$html) {
            $html = '';
        }

        // Transform multibyte entities which otherwise display incorrectly.
        $html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');

        // Internal errors enabled as HTML5 not fully supported.
        libxml_use_internal_errors(true);

        // Instantiate new DOMDocument object, and then load in UTF-8 HTML.
        $dom = new DOMDocument();
        $dom->encoding = 'UTF-8';
        $dom->loadHTML("<div>$html</div>");

        return $dom;
    }
1334815
protected function getHtmlDescription($html)
    {
        $content = '';
        $doc = new \DOMDocument;
        @$doc->loadHTML($html);
        $xpath = new \DOMXPath($doc);

        $query = '//p[preceding-sibling::p]';

        foreach ($xpath->query($query) as $node) {
            $content .= trim($node->textContent, PHP_EOL);
        }

        return $content;
    }
381147
public function nextPage()
    {
        if ($this->options['page'] < $this->pageTotal) {
            $next = Html::a($this->text['next'], $this->getUrl($this->nextPage));
            $next = $this->hasListElement($next);
        }

        $this->html['next'] = isset($next) ? $next : '';

        return $this;
    }
1246580
public function loadHTML($html)
    {
        $dom = new \DOMDocument();
        $dom->formatOutput = true;

        // strip illegal XML UTF-8 chars
        // remove all control characters except CR, LF and tab
        $html = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/u', '', $html); // 00-09, 11-31, 127

        $dom->loadHTML($html);
        $this->loadDomDocument($dom);
    }
590952
public function loadHTML($html)
    {
        if ($html instanceof Renderable) {
            $html = $html->render();
        }
        $this->html = $html;
        $this->file = null;
        return $this;
    }
576775
public function replaceMagicFields($html)
  {
    $html = str_replace('%id%', $this->getId(), $html);
    $html = str_replace('%class%', implode(' ', $this->classes), $html);
    $html = str_replace('%style%', $this->getStyle(), $html);

    $strAttributes = '';
    foreach ($this->attributes as $key => $value) {
      $strAttributes .= ' ' . $key . '="' . $value . '"';
    }
    $html = str_replace('%attributes%', $strAttributes, $html);
    return $html;
  }
643854
public function first($html, $html2 = '')
    {
        # Only show if you are not on page 1, otherwise show HTML2
        $r = ($this->get != 1) ? str_replace('{nr}', 1, $html) : str_replace('{nr}', 1, $html2);

        return $r;
    }
344264
public function render($html = null) {
		if ($html === null && $this->getHtml() === '') {
			$html = $this->getLink();
		}
		
		return parent::render($html);
	}
1332153
public function last($html, $html2 = '')
    {
        # Only show if you are not on the last page
        $r = ($this->get < $this->pages()) ? str_replace('{nr}', $this->pages(), $html) : str_replace('{nr}', $this->pages(), $html2);

        return $r;
    }