@@ -52,7 +52,9 @@ public function get_variables($add_entry_vars = false)
5252
5353 $ dom ->loadHTML ($ html );
5454
55- $ ul = $ dom ->getElementById ('nav-sub ' );
55+ $ separator = ee ()->config ->item ('word_separator ' ) !== 'dash ' ? '_ ' : '- ' ;
56+
57+ $ ul = $ dom ->getElementById ('nav ' .$ separator .'sub ' );
5658
5759 $ variables = $ this ->parse_ul ($ ul );
5860
@@ -371,13 +373,15 @@ protected function parse_ul(DOMElement $ul, $depth = 0)
371373
372374 $ numLis = count ($ lis );
373375
376+ $ separator = ee ()->config ->item ('word_separator ' ) !== 'dash ' ? '_ ' : '- ' ;
377+
374378 foreach ($ lis as $ i => $ li )
375379 {
376380 $ link = $ li ->firstChild ;
377381
378382 $ class = $ li ->getAttribute ('class ' );
379383
380- $ entry_id = str_replace ('nav- sub- ' , '' , $ li ->getAttribute ('id ' ));
384+ $ entry_id = str_replace ('nav ' . $ separator . ' sub ' . $ separator , '' , $ li ->getAttribute ('id ' ));
381385
382386 $ variables [$ i ] = array (
383387 '__prefix ' => $ prefix ,
@@ -390,7 +394,7 @@ protected function parse_ul(DOMElement $ul, $depth = 0)
390394 $ prefix .'count ' => $ i + 1 ,
391395 $ prefix .'total_results ' => $ numLis ,
392396 $ prefix .'active ' => !! preg_match ('/\bhere\b/ ' , $ class ),
393- $ prefix .'has_active_child ' => !! preg_match ('/\bparent- here\b/ ' , $ class ),
397+ $ prefix .'has_active_child ' => !! preg_match ('/\bparent ' . $ separator . ' here\b/ ' , $ class ),
394398 );
395399
396400 $ childUl = $ li ->getElementsByTagName ('ul ' )->item (0 );
0 commit comments