php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54364 Tidy doesn't merge-spans regardless of setting
Submitted: 2011-03-23 23:47 UTC Modified: 2011-03-24 16:08 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: mcamden at rubicon dot com Assigned:
Status: Not a bug Package: Tidy (PECL)
PHP Version: 5.3.6 OS: Windows 7
Private report: No CVE-ID: None
 [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>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-23 23:56 UTC] mcamden at rubicon dot com
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>
 [2011-03-24 02:29 UTC] dtajchreber@php.net
-Status: Open +Status: Bogus
 [2011-03-24 02:29 UTC] dtajchreber@php.net
$config = array('clean' => true, ...);
 [2011-03-24 16:08 UTC] mcamden at rubicon dot com
Yeah I feel stupid...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 11 00:01:31 2024 UTC