Add folding implementation that takes care of code blocks and lists.