Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.4

Bug #725 differs hierarchy elements with difference in spaces between
Submitted: 2004-02-10 14:00 UTC
From: maka3d at yahoo dot com dot br Assigned: thesaur
Status: Closed Package: HTML_CSS
PHP Version: Irrelevant OS: irrelevant
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 38 + 20 = ?

 
 [2004-02-10 14:00 UTC] maka3d at yahoo dot com dot br
Description: ------------ body td /* 3 spaces between body td */ is different from body td /* 1 space between body td */ patch: at line 356 on CSS.php change that line for this: $this->_css[$this->collapseInternalSpaces(trim($element))][$this->collapseInternalSpaces(trim($property))]= $this->collapseInternalSpaces(trim($value)); and add this method at end of class: function collapseInternalSpaces($subject){ return preg_replace("/\s+/", " ", $subject); } Reproduce code: --------------- $strcss = " body td { /* 3 spaces between body and td */ margin: 20px; padding: 20px; border: 0; color: #444; }"; require_once 'HTML/CSS.php'; $css = & new HTML_CSS(); $css->parseString($strcss); dump($css); $css->setStyle('body td ','margin',0); echo '<pre>'; echo $css->toString(); Expected result: ---------------- setStyle should change the body td not add an other one Actual result: -------------- add an other body td tag.

Comments

 [2004-02-25 16:24 UTC] thesaur at php dot net
Thank you for noticing this. I will fix it as soon as I can.
 [2004-03-24 21:21 UTC] thesaur at php dot net
This has been fixed in CVS. It will be included in the next release. Thank you for alerting me to this issue. If this does not sufficiently address the problem, please let me know.