This is a shortcode example.
[a][b]something[/b][/a]
It should be used like this with do_shortcode($content);
function a_shortcode($atts = [], $content = null) {
do_shortcode($content);
return $result;
}
add_shortcode('a', 'a_shortcode');
function b_shortcode($atts = [], $content = null) {
return $whatever;
}
add_shortcode('b', 'b_shortcode');
Is there a reason you dont use content without do_shortcode?
[a][b]something[/b][/a]
function a_shortcode($atts = [], $content = null) {
//use content here, parse [b]something[/b] as string and do whatever
return $result;
}