Fix multi-page articles

Reintroduce modification of the doc object because appendNextPage relies
on it.