tburry / pquery

A jQuery like html dom parser written php.
GNU Lesser General Public License v2.1
135 stars 25 forks source link

Broken javascript content #7

Closed fco64 closed 8 years ago

fco64 commented 9 years ago

Hi, First, sorry for my elementary English. I'll found that this istruction (gan_node_html.php line 465): function getPlainText() { return preg_replace('\s+', ' ', html_entity_decode($this->toString(true, true, true), ENT_QUOTES)); } will breaks embedded javascript with double slash comment. infact, the pattern \s+ will match spaces and newlines, so code block is trasformed into a single line entirely broken by comment starting with '//' Changing pattern in '\ +' (a space) trasformation works great. Hope this can help somebody Franco

tburry commented 8 years ago

I'm not sure if this is actually a bug and without a better example I'm going to have to close this issue.