I
I
Ivan Ivanov2020-05-07 10:47:21
PHP
Ivan Ivanov, 2020-05-07 10:47:21

Why does tidy::parseString() hang?

I use tidy. Here is a snippet:

$config = [
            'indent' => true,
            'output-xhtml' => true,
            'wrap' => 200
        ];
        var_dump('p1');
        if ($this->config['useTidy']) {
            // Tidy
            $tidy = new tidy;
            var_dump('p2');
            $tidy->parseString($html, $config, 'utf8');
            var_dump('p3');
            $tidy->cleanRepair();
            var_dump('p4');
            $html = $tidy;
        }


$html comes correct, really huge (5000+ lines), no matter how much time passes, parseString() does not stop running, tried to change the configs in every possible way - it didn’t help, you also can’t set a timeout, which is a pity

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question