I tried Jože’s example with hard-coded content, and it was good with the repeating paragraph name.
The code working with content and not with content[i] means the problem is after index .
You can debug your data using
print content before the loop.
Library Platform, Software Engineer