fixes different formatting contexts bug for context and footer