If the listener is not started yet, or it has stopped, we should
not try to format the document. This splits the checking into two
phases, improving things and laying the foundation for a complete
factoring out the common bits.
Change-Id: Ibff73a4979a5d67385f10647ca7c9ab64a35f42a Signed-off-by: Robert Varga <robert.varga@pantheon.tech>