Odd behaviour with php-tidy and new-blocklevel-tags

Konstantin Ryabitsev <[email protected]>
Newsgroups gmane.comp.web.html-tidy.user
Organization McGill University WSG
Message-ID <[email protected]>
Hello, all:

My apologies if this is the wrong list for php-tidy questions. I have 
tried filing a bug on the php tracker first, but they have told me to go 
here (I disagree, but hey). For reference, the php bug is here:
http://bugs.php.net/bug.php?id=39417

Quick summary from the bug here:

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>


Please feel free to tell me that this is a php lib problem -- I'll just 
reopen the bug on php.net.

Kind regards,
-- 
Konstantin Ryabitsev
McGill University WSG
Montréal, Québec
smime.p7s (application/x-pkcs7-signature, 3.2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.