Long story short: If you compile main.txt with pdflatex, you get the file main.pdf that has a mdframed box, that is unnecessarily split between page 2 and 3.