Given the example html:
<table>
<table bgcolor=beige>
<tbody>
<tr>
<td>TEST</td>
</tr>
</tbody>
</table>
Tidy produces the following:
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Mac OS X version 5.2.0">
<title></title>
</head>
<body>
<table>
<tbody>
<tr>
<td>TEST</td>
</tr>
</tbody>
</table>
</body>
</html>
According to the HTML5 spec and this fiddle the parser should close the first table element, then re-process the second table element.
Expected result:
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Mac OS X version 5.2.0">
<title></title>
</head>
<body>
<table>
</table>
<table bgcolor="beige">
<tbody>
<tr>
<td>TEST</td>
</tr>
</tbody>
</table>
</body>
</html>