Here is the problem, before_widget and after_widget outputs get placed before and after the complete sidebar section and not before and after the widgets.
The following code, in the functions file:
if (function_exists('register_sidebar')) { register_sidebar(array(
'name' => __( 'Modules' ),
'id' => 'aside-modules',
'description' => __( 'Place modules here.' ),
'before_widget' => '<section>',
'after_widget' => '</section',
'before_title' => '<h2>',
'after_title' => '</h2>'
));
}
gives me the mark-up of
<aside>
<section>
<h2></h2>
<ul><li></li></ul>
<h2></h2>
<ul><li></li></ul>
</section>
</aside>
However, the output should be:
<aside>
<section>
<h2></h2>
<ul><li></li></ul>
</section>
<section>
<h2></h2>
<ul><li></li></ul>
</section>
</aside>