\captionof changes \parskip and \parindent to 0pt

The \captionof resets some paragraph related values but doesn't restore them but seem to rely on some grouping:

\documentclass{article}
\usepackage{caption}
\usepackage{lipsum}

\begin{document}
\noindent
\begin{minipage}{\textwidth}
\parskip=1em \parindent=1em

\lipsum[1-2]

\captionof{figure}{blub}

\lipsum[1-2]
\end{minipage}


\end{document}

image