This shows the 'previous' 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
330563
public function previous($html, $html2 = '')
    {
        # Only show if you are not on page 1, otherwise show HTML2
        $r = ($this->get != 1) ? str_replace('{nr}', $this->get - 1, $html) : str_replace('{nr}', $this->get - 1, $html2);

        return $r;
    }
107592
protected function nodesFromHtml($html): NodeList {
        $class = get_class($this->document());
        $doc = new $class();
        $nodes = $doc->html($html)->find('body > *');

        return $nodes;
    }
1008004
public function prevAcrossPages()
    {
        $prevAcrossPages = $this->options['page'] - $this->options['btnNum'];

        if ($prevAcrossPages > 0) {
            $text = sprintf($this->text['prevs'], $this->options['btnNum']);
            // return '<a href="'.$this->getUrl($prevAcrossPages).'" class="number" title="'.$text.'">'.$text.'</a>';
            $prevs = Html::a($text, $this->getUrl($prevAcrossPages), ['title' => $text]);
            $prevs = $this->hasListElement($prevs);
        }

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

        return $this;
    }
874871
public function setHtml($html = null)
    {
        $html = trim($html);
        $this->html = 0 < strlen($html) ? $html : null;

        return $this;
    }
1049997
public function setHtml($html)
    {
        if (!\is_string($html)) {
            throw new \InvalidArgumentException('The provided HTML must be a string.', 1540403913);
        }
        if ($html === '') {
            throw new \InvalidArgumentException('The provided HTML must not be empty.', 1540403910);
        }

        $this->createUnifiedDomDocument($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;
    }
1190660
public static function htmlToPlainText($html)
    {
        // Replace &nbsp; with spaces
        $html = str_replace("\xC2\xA0", ' ', html_entity_decode($html));
        // Strip out HTML tags
        $text = strip_tags($html);
        // Replace excessive whitespace (spaces, tabs, and line breaks) with single space
        $text = preg_replace('/\s+/S', ' ', $text);

        return $text;
    }
6547
protected function getPrevLink()
    {
        if(!($sCall = $this->xPaginator->getPrevCall()))
        {
            return '';
        }
        return $this->xTemplate->render('pagination::links/prev',
            ['call' => $sCall, 'text' => $this->xPaginator->getPreviousText()]);
    }
548875
public function previous($marker = null)
	{
		$html = '';

		$marker === null and $marker = $this->template['previous-marker'];

		if ($this->config['total_pages'] > 1)
		{
			if ($this->config['calculated_page'] == 1)
			{
				$html = str_replace(
				    '{link}',
				    str_replace(array('{uri}', '{page}'), array('#', $marker), $this->template['previous-inactive-link']),
				    $this->template['previous-inactive']
				);
				$this->raw_results['previous'] = array('uri' => '#', 'title' => $marker, 'type' => 'previous-inactive');
			}
			else
			{
				$previous_page = $this->config['calculated_page'] - 1;
				$previous_page = ($previous_page == 1) ? '' : $previous_page;

				$html = str_replace(
				    '{link}',
				    str_replace(array('{uri}', '{page}'), array($this->_make_link($previous_page), $marker), $this->template['previous-link']),
				    $this->template['previous']
				);
				$this->raw_results['previous'] = array('uri' => $this->_make_link($previous_page), 'title' => $marker, 'type' => 'previous');
			}
		}

		return $html;
	}
9679
function renderPrev($tag = '&lt;&lt;') {
        if ($this->total_rows == 0)
            return FALSE;
         
        if ($this->page > 1) {
            //return ' <a href="' . $this->php_self . '?page=' . ($this->page - 1) . '&' . $this->append . '">' . $tag . '</a>';
            $pageno = $this->page - 1;
            return " <a href='javascript:void(0);' OnClick='getdata( $pageno )' title='Anterior'>$tag</a> ";
        } else {
            return " $tag ";
        }
    }
206414
public static function removeEmptyLines($html) {
    // merge multiple linebreaks to one
    $html = preg_replace("/(<br>\s*)+/", "<br>", $html);
    // remove linebreaks at the beginning of a paragraph
    $html = preg_replace("/<p>(\s|<br>)*/", "<p>", $html);
    // remove linebreaks at the end of a paragraph
    $html = preg_replace("/(\s|<br>)*<\/p>/", "</p>", $html);
    // remove empty paragraphs
    $html = preg_replace("/<p><\/p>/", "", $html);
    return $html;
  }
1005359
public function convertToString($html)
    {
        $extractedStylesheets = $this->extractExternalStylesheets($html);
        $links = $this->createStylesheetPaths($extractedStylesheets['links']);

        $externalStylesheets =  array(
            'tags' => $extractedStylesheets[0],
            'links' => $links
        );

        $html = $this->replaceExternalCss($html, $externalStylesheets);

        return $html;
    }
184998
private function eliminateLink(string $html): string
    {
        $count = 0;
        $notLinked = preg_replace_callback('/<a\s[^>]*>.*?<\/a\s*>/ius', function () use (&$count) {
            $count++;

            return '';
        }, $html);
        $notLinked = preg_replace('/<form\s[^>]*>.*?<\/form\s *>/imsu', '', $notLinked);
        $notLinked = strip_tags($notLinked);

        if (strlen($notLinked) < 20 * $count || $this->isLinkList($html)) {
            return '';
        }

        return $notLinked;
    }
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;
    }
1357190
public function prepareHtml($html)
    {
        // if it is a real html page, we have to convert it
        if (preg_match('/<body/isU', $html)) {
            $html = $this->getHtmlFromRealPage($html);
        }

        // replace some constants
        $html = str_replace('[[date_y]]', date('Y'), $html);
        $html = str_replace('[[date_m]]', date('m'), $html);
        $html = str_replace('[[date_d]]', date('d'), $html);

        $html = str_replace('[[date_h]]', date('H'), $html);
        $html = str_replace('[[date_i]]', date('i'), $html);
        $html = str_replace('[[date_s]]', date('s'), $html);

        return $html;
    }
116761
public function parseString($html)
    {
        /** TODO: custom markdown-extra options, e.g. titles & classes **/
        // <sup id="fnref:..."><a href"#fn..." rel="footnote">...</a></sup>
        // => <fnref target="..." />
        $html = preg_replace('@<sup id="fnref:([^"]+)">\s*<a href="#fn:\1" rel="footnote">\s*\d+\s*</a>\s*</sup>@Us', '<fnref target="$1" />', $html);
        // <div class="footnotes">
        // <hr />
        // <ol>
        //
        // <li id="fn:...">...</li>
        // ...
        //
        // </ol>
        // </div>
        // =>
        // <footnotes>
        //   <fn name="...">...</fn>
        //   ...
        // </footnotes>
        $html = preg_replace_callback('#<div class="footnotes">\s*<hr />\s*<ol>\s*(.+)\s*</ol>\s*</div>#Us', [&$this, '_makeFootnotes'], $html);

        return parent::parseString($html);
    }
1063323
public static function absoluteURLs($html)
    {
        $html = str_replace('$CurrentPageURL', Controller::curr()->getRequest()->getURL(), $html);
        return HTTP::urlRewriter($html, function ($url) {
            //no need to rewrite, if uri has a protocol (determined here by existence of reserved URI character ":")
            if (preg_match('/^\w+:/', $url)) {
                return $url;
            }
            return Director::absoluteURL($url, true);
        });
    }