[php-src] Issue #20374: PHP with tidy and custom-tags

From: Date: Mon, 03 Nov 2025 12:42:53 +0000
Subject: [php-src] Issue #20374: PHP with tidy and custom-tags
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-251167@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/20374
Author: franck-paul

### Description

The following code:

```php
<?php
$str = '<custom-html-element>test</custom-html-element>';

$config = [
	'custom-tags' => 'blocklevel',
];

$tidy = new \tidy();
$tidy->parseString($str, $config, 'utf8');
$tidy->cleanRepair();

$str = (string) $tidy->value;

var_dump($str);	// should be <custom-html-element>test</custom-html-element>
```

Resulted in this output:
```
test
```

But I expected this output instead:
```
<custom-html-element>test</custom-html-element>
```


### PHP Version

```plain
PHP 8.4.14 (cli) (built: Oct 21 2025 19:23:55) (NTS)
Copyright (c) The PHP Group
Built by Homebrew
Zend Engine v4.4.14, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.14, Copyright (c), by Zend Technologies
    with Xdebug v3.4.0, Copyright (c) 2002-2024, by Derick Rethans
```

### Operating System

MacOS


Thread (1 message)

  • franck-paul
« previous php.bugs (#251167) next »