|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-11-07 22:19 UTC] konstantin dot ryabitsev at mcgill dot ca
Description:
------------
I seem to get odd behaviour running the following code. Theoretically (and confirmed by running command-line tidy utility), the output should contain all namespace-prepended tags. On my machine, the output only contains the <wps:block> element, and none of the elements contained within.
It's really weird. If I change the names to "wps:blo", "wps:var" and "wps:val", it works. I'm really confused at this point.
Reproduce code:
---------------
<?php
$contents = '
<wps:block>
<wps:var>
<wps:value/>
</wps:var>
</wps:block>';
$config = array(
'new-blocklevel-tags' => 'wps:block,wps:var,wps:value'
);
$tidy = tidy_parse_string($contents, $config, 'utf8');
$tidy->cleanRepair();
print "{$tidy->value}\n";
?>
Expected result:
----------------
<html>
<head>
<title></title>
</head>
<body>
<wps:block>
<wps:var>
<wps:value></wps:var>
</wps:block>
</body>
</html>
Actual result:
--------------
<html>
<head>
<title></title>
</head>
<body>
<wps:block>
</body>
</html>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 12:00:01 2025 UTC |
No, same results with the latest CVS snapshot. I have now been able to reproduce this problem on the followin systems: * Fedora Core 5 * Fedora Core 6 * RHEL 4 * Debian Unstable It's not a corner case. --------------------------- icon@rakta:[~]$ cat tidy.php <?php $contents = ' <wps:block> <wps:var> <wps:value/> </wps:var> </wps:block>'; $config = array( 'new-blocklevel-tags' => 'wps:block,wps:value,wps:var' ); $tidy = tidy_parse_string($contents, $config, 'utf8'); $tidy->cleanRepair(); print "{$tidy->value}\n"; ?> icon@rakta:[~]$ php -version PHP 5.2.1-dev (cli) (built: Nov 23 2006 15:32:59) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies icon@rakta:[~]$ php tidy.php <html> <head> <title></title> </head> <body> <wps:block> </body> </html>Works just fine here using both libtidy-CVS and default SuSE version (built on Mar 19 2005). Please update libtidy to the latest CVS, and if that doesn't help, harp on this to libtidy developers. # ./sapi/cli/php /tmp/2.php <html> <head> <title></title> </head> <body> <wps:block><wps:var> <wps:value></wps:var></wps:block> </body> </html> # cat /tmp/2.php <?php $contents = ' <wps:block> <wps:var> <wps:value/> </wps:var> </wps:block>'; $config = array( 'new-blocklevel-tags' => 'wps:block,wps:value,wps:var' ); $tidy = tidy_parse_string($contents, $config, 'utf8'); $tidy->cleanRepair(); print "{$tidy->value}\n"; ?>We are at least two persons on earth :-) [belbo@abu tmp]$ php -version PHP 5.1.6 (cli) (built: Nov 2 2006 16:46:15) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies [belbo@abu tmp]$ rpm -q libtidy libtidy-0.99.0-11.20051025.fc6 [belbo@abu tmp]$ rpm -q php-tidy php-tidy-5.1.6-1.fc6 [belbo@abu tmp]$ cat tidy.php <?php $contents = ' <wps:block> <wps:var> <wps:value/> </wps:var> </wps:block>'; $config = array( 'new-blocklevel-tags' => 'wps:block,wps:value,wps:var' ); $tidy = tidy_parse_string($contents, $config, 'utf8'); $tidy->cleanRepair(); print "{$tidy->value}\n"; ?> [belbo@abu tmp]$ php tidy.php <html> <head> <title></title> </head> <body> <wps:block> </body> </html>