paquettg / php-html-parser

An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.
MIT License
2.37k stars 461 forks source link

Symbol "{" inside meta tag content attribute partially breaks the parser #292

Open yalexwander opened 3 years ago

yalexwander commented 3 years ago

When HTML document contains a fragment like:

<meta property="og:description" content="Route::register( [ '/' =&gt; 'Home', '/user/$id/profile' =&gt; function ($id) {echo &quot;Вы указали &quot; . (int) $id . &quot; в адре...">

It makes parsing the document incorrect - some nodes disappears. See test files and test runner in my repo: https://github.com/yalexwander/php-html-parser-bug-example

I'm not even sure if it is a bug or expected behavior.

fsa commented 1 year ago

Confirm.

<h4><a href="URL" title="Просмотр профиля }I{eKa">}I{eKa</a></h4>

Part of the text is missing and the logic on the { sign is broken.