Fix bad encoding for `tidy_repair_string`

Tidy on PHP 8.5 is more restrictive on what can be given as input encoding. Before, it worked as an unknown value was converted to `utf8`.
pull/112/head
Jeremy Benoist 4 days ago
parent e4e975db96
commit 952588ee1f
No known key found for this signature in database
GPG Key ID: 7168D5DD29F38552
  1. 2
      src/Readability.php
  2. 1
      tests/ReadabilityTest.php

@ -118,7 +118,7 @@ class Readability implements LoggerAwareInterface
'enclose-text' => true,
'merge-divs' => true,
// 'merge-spans' => true,
'input-encoding' => '????',
'input-encoding' => 'utf8',
'output-encoding' => 'utf8',
'hide-comments' => true,
];

@ -17,6 +17,7 @@ class ReadabilityTest extends \PHPUnit\Framework\TestCase
public function testConstructDefault()
{
$readability = $this->getReadability('');
$this->assertSame('utf8', $readability->tidy_config['input-encoding']);
$this->assertNull($readability->url);
$this->assertInstanceOf(\DOMDocument::class, $readability->dom);

Loading…
Cancel
Save