This bug is not only with PDF.
Please try the first example 3 jpeg links. They don’t open new tabs, but you lose Discourse context and navigation.
It’s even better to test on this very forum (meta):
This PNG link* does not open in a new tab (this is the bug).
But you still lose Discourse context and navigation, unexpectedly, so I think it should be treated like an external link.
* Manually copied from this post