Adapt html generation to prepare htmlSerializer