XRENDERING-373: PutFootnotes macro does not work properly inside HTML macro

(cherry picked from commit 75a7038be401b2d671f0402d0cce73e2f5402d30)