php-simple-html-dom-parser
php-simple-html-dom-parser copied to clipboard
tag attributes missing
Here is my testing code:
$CC = <<<EOF
<p style="max-width: 100%; min-height: 1em; white-space: pre-wrap; color: rgb(62, 62, 62); text-align: center; font-family: 微软雅黑; font-size: 14px; line-height: 24px; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);"><img img_width="500" img_height="398" data-type="jpeg" data-ratio="NaN" data-w="0" width="auto" width="auto" data-src="http://mmbiz.qpic.cn/mmbiz/fZ6yVsBCVhLQdrDUBay4Ps1qhhKGiadibMIdicxOXx74cXsIVxk0Emib1XpZxHUXLuToWEMibPRr0I8noqtuWZfowNg/640?wx_fmt=jpeg"/></p>
EOF;
//well, load the class as u often do
//Loader::import('SimpleHtmlDom', 'html');
$DOM = str_get_html($CC);
if ( $DOM == false )
{
return false;
}
echo $DOM->innertext;
and output is:
<p style="max-width: 100%; min-height: 1em; white-space: pre-wrap; color: rgb(62, 62, 62); text-align: center; font-family: 微软雅黑; font-size: 14px; line-height: 24px; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);"><img img_width="500" img_height="398" data-type="jpeg" data-ratio="NaN" data-w="0" width="auto"></p>
well, something is missing.
if i comment the code fragment bettween line 1488 to 1491 and i would got what i want:
if (isset($node->attr[$name]))
{
return;
}
it maybe a bug!