|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-07-30 19:25 UTC] mike@php.net
-Package: Output Control
+Package: Tidy
[2013-07-31 05:36 UTC] yohgaki@php.net
-Status: Open
+Status: Wont fix
[2013-07-31 05:36 UTC] yohgaki@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 17:00:01 2025 UTC |
Description: ------------ Tidy seems to injecting markup to unexpected places. As can be seen from the below code. There's a place where I have an orphan closing </i> tag within an unclosed paragraph tag. <p>paragraph</i><p/> It's injecting the following markup within the paragraph tags: <span style="padding:10px"> Tidy package info: Tidy support => enabled libTidy Release => 14 June 2007 Extension Version => 2.0 ($Id: tidy.c,v 1.66.2.8.2.26 2008/12/31 11:17:46 sebastian Exp $) Short code snippet to reproduce the bug - please see below. List of modules: --with-apxs2=/usr/local/apache2/bin/apxs' '--with-zlib=/usr' '--with-pspell=/usr' '--prefix=/usr' '--with-config-file-path=/etc' '--libexecdir=/usr/libexec' '--with-curl' '--enable-memory-limit' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-iconv' '--with-expat-dir=/usr' '--enable-magic-quotes' '--enable-track-vars' '--enable-dio' '--without-sqlite' '--with-xml2' '--with-xmlrpc' '--enable-pcntl' '--disable-debug' '--enable-inline-optimization' '--enable-mbstring' '--enable-mm=shared' '--enable-safe-mode' '--enable-trans-sid' '--enable-wddx=shared' '--enable-xml' '--with-regex=system' '--with-xsl' '--with-tidy=/usr Test script: --------------- <?php $html = ' <html> <head> <title>test</title> </head> <body> & <div Hello world again <div> <span style="padding:10px"> There are 12 columns in the grid Hello world<br> </div> <p>paragraph</i><p/> </body> </html>'; // Specify configuration $config = array( 'indent' => true, 'output-xhtml' => true, 'wrap' => 200, 'clean' => true, 'bare' => true, 'preserve-entities' => true ); $tidy = new tidy(); $clean = $tidy->repairString($html, $config, 'utf8'); // Output echo $clean; ?> Expected result: ---------------- Expected result: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> test </title> </head> <body> & <div hello="" world="" again=""></div> <div> <span style="padding:10px">There are 12 columns in the grid Hello world<br /></span> </div> <p> paragraph </p> </body> </html> However in an dream world where computers know what I want - this statement would also be - <div hello="" world="" again=""></div> changed to this: <div> hello world again </div> Actual result: -------------- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> test </title> </head> <body> & <div hello="" world="" again=""></div> <div> <span style="padding:10px">There are 12 columns in the grid Hello world<br /></span> </div> <p> <span style="padding:10px">paragraph</span> </p> </body> </html>