|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-03-23 23:47 UTC] mcamden at rubicon dot com
Description:
------------
Tidy does not merge spans regardless of the configuration. According to the tidy
website the merge-spans configuration option is defaulted to 'auto'. PHP reflects
this setting with the number 2. However leaving it defaulted to 'auto' or setting
to TRUE does not merge spans.
Test script:
---------------
$html = '<p><span><span><span>a</span></span></span></p>';
$config = array('merge-spans' => TRUE);
$tidy = tidy_parse_string($html, $config, 'UTF8');
$tidy->cleanRepair();
echo $tidy;
Expected result:
----------------
<p><span>a</span></p>
Actual result:
--------------
<p><span><span><span>a</span></span></span></p>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Mar 04 15:00:01 2026 UTC |
I'm not sure if this is related, but the same is true for merge-divs. Script: $html = '<p><div><div><div>a</div></div></div></p>'; $config = array('merge-spans' => TRUE); $tidy = tidy_parse_string($html, $config, 'UTF8'); $tidy->cleanRepair(); echo $tidy; Result: <p><div><div><div>a</div></div></div></p>$config = array('clean' => true, ...);