php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #50074 wrap-tags Config Option in tidy
Submitted: 2009-11-04 10:32 UTC Modified: 2012-01-21 11:39 UTC
From: t dot peter at retepsamoht dot de Assigned:
Status: Not a bug Package: Tidy (PECL)
PHP Version: 5.2.11 OS: Linux
Private report: No CVE-ID: None
 [2009-11-04 10:32 UTC] t dot peter at retepsamoht dot de
Description:
------------
I?d really like to have a config option in tidy_parse_string() that enables/disables wraps within tags. 

This would make code reading much easier, especially for HTML/PHP Beginners. 

Reproduce code:
---------------
---
From manual page: book.tidy
---

<?php
$html = '<div id="mainmenu"><span class="active">Home</span>| 
<a href="planung.php" title="Planung">Planung</a>| 
<a href="audio.php" title="Audio">Audio</a>|
<a href="video.php" title="Video">Video</a>| 
<a href="netzwerk.php" title="Netzwerk">Netzwerk</a>| 
<a href="service.php" title="Service">Service</a>| 
<a href="shop.php" title="Shop">Shop</a>| 
<a href="referenzen.php" title="Referenzen">Referenzen</a>|
<a href="kontakt.php" title="Kontakt">Kontakt</a>| 
<a href="impressum.php" title="Impressum">Impressum</a>| 
<a href="agbs.php" title="AGBs">AGBs</a></div>';


$config = array('indent' => TRUE,
                'output-xhtml' => TRUE,
                'wrap' => 200);

$tidy = tidy_parse_string($html, $config);

print_r($tidy->getConfig());
?>


Expected result:
----------------
No breaks within tags. Nice and easy to read.

<div id="mainmenu">
  <span class="active">Home</span>| 
  <a href="planung.php" title="Planung">Planung</a>| 
  <a href="audio.php" title="Audio">Audio</a>|
  <a href="video.php" title="Video">Video</a>| 
  <a href="netzwerk.php" title="Netzwerk">Netzwerk</a>| 
  <a href="service.php" title="Service">Service</a>| 
  <a href="shop.php" title="Shop">Shop</a>| 
  <a href="referenzen.php" title="Referenzen">Referenzen</a>|
  <a href="kontakt.php" title="Kontakt">Kontakt</a>| 
  <a href="impressum.php" title="Impressum">Impressum</a>| 
  <a href="agbs.php" title="AGBs">AGBs</a>
</div>


Actual result:
--------------
Something like that: Breaks within tags. 


<div id="mainmenu">
  <span class="active">Home</span>| <a href="planung.php"    
  title="Planung">Planung</a>| <a href="audio.php"   
  title="Audio">Audio</a>|
  <a href="video.php" title="Video">Video</a>| 
  <a href="netzwerk.php" title="Netzwerk">Netzwerk</a>| <a      
  href="service.php" title="Service">Service</a>| <a 
  href="shop.php" title="Shop">Shop</a>| <a href="referenzen.php"     
  title="Referenzen">Referenzen</a>| <a href="kontakt.php" 
  title="Kontakt">Kontakt</a>| <a href="impressum.php"  
  title="Impressum">Impressum</a>| <a href="agbs.php"
  title="AGBs">AGBs</a>
</div>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-20 09:54 UTC] jani@php.net
-Package: Feature/Change Request +Package: Tidy
 [2012-01-21 11:39 UTC] nlopess@php.net
-Status: Open +Status: Bogus
 [2012-01-21 11:39 UTC] nlopess@php.net
not php issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 07:01:32 2024 UTC