Ref https://github.com/jquery/jquery/blob/master/src/manipulation.js#L293 onwards
If you attempt to add a tr to a table, jQuery will realise that you're adding a tr and attempt to check that you're adding it to a table with a tbody, and if not, it will wrap the tr in a tbody before adding it to the table.
Ordinarily this would be fine, but I have the situation where I have a table with multiple tbody tags, each of which with ids. The problem is that if I select my tbody directly, my tr is added with a nested tbody (creating tbody#myid tbody tr as a hierarchy)
Line 314 shows it looking for a table with tbody, which is fine if you're targeting the table directly but in my case I'm not targeting the table, I need to target the tbody specifically to add it to the right container.
Currently I'm adding it to the tbody, then performing $("tbody#myid tbody tr").unwrap(); afterwards to strip the extra layer of tbody that's unnecessary, but as you can probably imagine I'd prefer not to do that.
I should also add, the original version of the code was written a year or more ago and I seem to remember we were using 1.5.2 back then - but back then, the code indicated worked fine (i.e. I could select a tbody by id and then directly append tr to it without any problems) so I'm wondering if this is a regression.