The one in Handlebar is likely to be more upto date than the flexibase one
https://gitlab.com/ro-mdl-themes/moodle-theme_handlebar/blob/master/classes/output/core_renderer.php#L67-120
Hope it helps
https://gitlab.com/ro-mdl-themes/moodle-theme_handlebar/blob/master/classes/output/core_renderer.php#L67-120
Hope it helps