[quote='861567022, JWWalker, /thread/803249?answerId=861567022#861567022, /profile/JWWalker'] No idea what you mean by that? [/quote]
It looks like an autocorrection. It should have been "overflow".
But that's irrelevant. I was just confused by your GitHub link. It was GitHub that printed properly. Now that I know what you're doing, I can reproduce the problem.
It seems clear that it's the dynamic markdown that's causing all the trouble. If you look closely in the print preview, you can see that the top margin on page 1 is wrong. The first element is right up at the top of the page. That throws off the page count because the full print does it properly.
I was also able to easily hack up my older app and have it swap out its own data for your markdown-html. The first time I tried it, both the preview and the output came out short, at only 8 pages. But all subsequent attempts worked properly, printing all 13 pages (with my headers). I think WebKit is caching this data. That's why it only fails the first time.
When I swapped out the legacy for the new, all I could only ever get was a single page. I think the new renders much faster and that's why it only has a single page at print time. This old app does both the legacy and the new WebKit, so it has a lot of overhead. That explains why I can only get a single page whereas a simple app gets 11.
I'm taking care to avoid printing until the document ready event in Javascript. So this markdown parsing must be happening after that. That would explain these results. It simply hasn't finished rendering the page when it gets the page count.
And I ran the rendered HTML from Safari through the W3C HTML validator. It's not valid HTML. Like any browser, WebKit tries to compensate. But combined with the Javscript rendering, it seems to be too much for it to handle.
Good luck on your bug report. But until that's fixed, I recommend static HTML.