Example of WordPress default CSS class output:
&l
My solution:
$defaults = array(
'theme_location' => '',
'menu' => '',
'container' => '',
'container_class' => '',
'container_id' => '',
'menu_class' => '',
'menu_id' => '',
'echo' => false, // param important
'fallback_cb' => 'wp_page_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '',
'depth' => -1,
'walker' => ''
);
ob_start();
echo preg_replace( '#- ]+>#', '
- ', wp_nav_menu( $defaults ) );
$mainNav = ob_get_clean();
// In the page :
echo $mainNav;