Just wanted to add to this since I was referencing the same question and couldn't get the code to work. ( It seems obvious now, but wasn't thinking at the time. ) In order for the code to work you need to load the jquery into the header code injection. So in all:
Header add -
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
Footer add -
<script>
$(document).ready(function(){
$("h2.list-item-content__title").each(function(){
$(this).html($(this).text());
});
});
</script>
Hope that helps.