convertDocumentToHTML now returns fragments