@@ -176,15 +176,15 @@ class Emogrifier {
176176 // exact attribute
177177 '/( \\w) \\[( \\w+) \\=[ \'"]?([ \\w \\s]+)[ \'"]? \\]/ ' => '\\1[@ \\2=" \\3"] ' ,
178178 // element attribute~=
179- '/([ \\w \\*]+) \\[( \\w+)[ \\s]* \\~ \\=[ \\s]*[ \'"]?([ \\w-_ \\/]+)[ \'"]? \\]/ ' => '\\1[contains(concat(" ", @ \\2, " "), concat(" ", " \\3", " "))] ' ,
179+ '/([ \\w \\*]+) \\[( \\w+)[ \\s]* \\~ \\=[ \\s]*[ \'"]?([ \\w\ -_ \\/]+)[ \'"]? \\]/ ' => '\\1[contains(concat(" ", @ \\2, " "), concat(" ", " \\3", " "))] ' ,
180180 // element attribute^=
181- '/([ \\w \\*]+) \\[( \\w+)[ \\s]* \\^ \\=[ \\s]*[ \'"]?([ \\w-_ \\/]+)[ \'"]? \\]/ ' => '\\1[starts-with(@ \\2, " \\3")] ' ,
181+ '/([ \\w \\*]+) \\[( \\w+)[ \\s]* \\^ \\=[ \\s]*[ \'"]?([ \\w\ -_ \\/]+)[ \'"]? \\]/ ' => '\\1[starts-with(@ \\2, " \\3")] ' ,
182182 // element attribute*=
183- '/([ \\w \\*]+) \\[( \\w+)[ \\s]* \\* \\=[ \\s]*[ \'"]?([ \\w-_ \\s \\/:;]+)[ \'"]? \\]/ ' => '\\1[contains(@ \\2, " \\3")] ' ,
183+ '/([ \\w \\*]+) \\[( \\w+)[ \\s]* \\* \\=[ \\s]*[ \'"]?([ \\w\ -_ \\s \\/:;]+)[ \'"]? \\]/ ' => '\\1[contains(@ \\2, " \\3")] ' ,
184184 // element attribute$=
185- '/([ \\w \\*]+) \\[( \\w+)[ \\s]* \\$ \\=[ \\s]*[ \'"]?([ \\w-_ \\s \\/]+)[ \'"]? \\]/ ' => '\\1[substring(@ \\2, string-length(@ \\2) - string-length(" \\3") + 1) = " \\3"] ' ,
185+ '/([ \\w \\*]+) \\[( \\w+)[ \\s]* \\$ \\=[ \\s]*[ \'"]?([ \\w\ -_ \\s \\/]+)[ \'"]? \\]/ ' => '\\1[substring(@ \\2, string-length(@ \\2) - string-length(" \\3") + 1) = " \\3"] ' ,
186186 // element attribute|=
187- '/([ \\w \\*]+) \\[( \\w+)[ \\s]* \\| \\=[ \\s]*[ \'"]?([ \\w-_ \\s \\/]+)[ \'"]? \\]/ ' => '\\1[@ \\2=" \\3" or starts-with(@ \\2, concat(" \\3", "-"))] ' ,
187+ '/([ \\w \\*]+) \\[( \\w+)[ \\s]* \\| \\=[ \\s]*[ \'"]?([ \\w\ -_ \\s \\/]+)[ \'"]? \\]/ ' => '\\1[@ \\2=" \\3" or starts-with(@ \\2, concat(" \\3", "-"))] ' ,
188188 ];
189189
190190 /**
@@ -339,7 +339,7 @@ protected function process( DOMDocument $xmlDocument ) {
339339 // Also store a reference of nodes with existing inline styles so we don't overwrite them.
340340 $ this ->purgeVisitedNodes ();
341341
342- // set_error_handler( [$this, 'handleXpathError'], E_WARNING );
342+ set_error_handler ( [$ this , 'handleXpathError ' ], E_WARNING );
343343
344344 $ nodesWithStyleAttributes = $ xPath ->query ( '//*[@style] ' );
345345
0 commit comments