File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed
astroid/astroid-framework/framework/library/astroid/Component Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -248,24 +248,29 @@ public static function exclidedViews($views = '')
248248 public static function selectedClasses (&$ matches , $ classes = '' , $ toggle = '' )
249249 {
250250 $ classes = array_map ('trim ' , explode ("\n" , $ classes ));
251-
252251 foreach ($ matches [0 ] as $ key => $ match ) {
253- foreach ($ classes as $ classname ) {
254- $ classExists = preg_match ('@class=[\" \'].* ' . $ classname . '.*[\" \']@Ui ' , $ match );
252+ $ classExists = false ;
255253
256- if ($ toggle == 'include ' ) {
257- if (empty ($ classExists )) {
258- unset($ matches [0 ][$ key ]);
259- unset($ matches [1 ][$ key ]);
260- }
261-
262- continue ;
254+ foreach ($ classes as $ classname ) {
255+ $ exists = preg_match ('@class=[\" \'].* ' . $ classname . '.*[\" \']@Ui ' , $ match );
256+ if (!empty ($ exists )) {
257+ $ classExists = true ;
258+ break ;
263259 }
260+ }
264261
265- if (!empty ($ classExists )) {
262+ if ($ toggle == 'include ' ) {
263+ if (!$ classExists ) {
266264 unset($ matches [0 ][$ key ]);
267265 unset($ matches [1 ][$ key ]);
268266 }
267+
268+ continue ;
269+ }
270+
271+ if (!empty ($ classExists )) {
272+ unset($ matches [0 ][$ key ]);
273+ unset($ matches [1 ][$ key ]);
269274 }
270275 }
271276 }
You can’t perform that action at this time.
0 commit comments