Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix handling of amp-bind attributes to ensure that “>” can appear inside attribute values #1119
The key part to getting this to work on large data sets was something new to me in regex: Possessive Quantifiers. This prevents backtracking and avoids
So now WordPress-served responses can successfully include:
<body class="bar" [class]="bodyClasses.concat( isBar ? 'bar' : '' ).filter( className => '' != className )">
Whereas previously this would fail and cause
There was no perceived change in performance between the old and new regex patterns.
Again, the reason for all of this regex replacing is because PHP's DOMDocument (via libxml) does not like the bracketed amp-bind attribute syntax. So we have to convert them prior to parsing and restore them after serializing.