No, it only applys it to each line once, the second rstrip call is to the whole contents, not sure what it and the third manual removal is for, I suspect that could be removed but maybe there is/was a Windows/python 2 reason?
That said, probably the whole script could be removed since Geany itself can do those things and wholesale applying it to files is risky since in markdown two trailing spaces are markup.