Turns out I have more pressing matters and didn't have time to refine and test the patch... Instead of delaying the fix further, I just pushed the patch to #307.
I'll refine it and rewrite our currently useless testing system later, but let's have a working release first...
Switch to modern UA and fix parser
==================================
Fixes #306, hopefully.
Not refined (even left a TODO), not extensively tested against edge cases.