If you stick golf tees in the ends of the hoses, you can stem the flow of gas leakage. Unfortunately, I have to confess that this was not my idea, but works quite well.

I see I should have read the service manual before starting this procedure. Remove fuse? Crank the engine?

I did neither of these things, but thankfully, my engine started right up after replacing the fuel filter.
_________________________
I started off with nothing and still have some left.