Bug 158525 - Import of nested table from HTML ends up all wrong
Summary: Import of nested table from HTML ends up all wrong
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: HTML-Import
  Show dependency treegraph
 
Reported: 2023-12-04 19:16 UTC by Jan krynicky
Modified: 2023-12-09 11:43 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
An example html document (4.99 KB, text/html)
2023-12-04 19:17 UTC, Jan krynicky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan krynicky 2023-12-04 19:16:22 UTC
Description:
... and all attempts to move the nested table where it belongs fail.

The HTML is like this
<table>
<tr>
 <td>header1</td>
 <td>header2</td>
 <td>header3</td>
</tr>
<tr>
 <td><table ... </table></td>
 <td><table ... </table></td>
 <td><table ... </table></td>
</tr>
</table>

but no matter whether I open the HTML file or select the page and paste from Edge I end up with 

|---------------------------------|
|header1   |  header2 |  header3  |
|          |          |  [whole ] |
|          |          |  [nested] |
|          |          |  [table ] |
|          |          |  [ 3 ]    |
|---------------------------------|
|[ whole ] | [ whole ]|           |
|[ nested] | [ nested]|           |
|[ table ] | [ table ]|           |
|[ 1     ] | [  2    ]|           |
|---------------------------------|

and if I try select the nested table and either move or copy it into the right cell of the outer one, it gets dissolved and I end up with 

Steps to Reproduce:
<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="utf-8" />
	<title></title>
</head>
<body>
	<h2>Present tense</h2>
	<table>
		<tr>
			<td><h3>Indefinite</h3></td>
			<td><h3>Definite</h3></td>
			<td><h3>-ik verbs</h3></td>
		</tr>
		<tr>
			<td>
				<table border="1">
					<tr>
						<th rowspan="3">
							Person
						</th>
						<th colspan="3">
							Endings
						</th>
					</tr>
					<tr>
						<th rowspan="2">
							back
						</th>
						<th colspan="2">
							front
						</th>
					</tr>
					<tr>
						<th>
							short
						</th>
						<th>
							long
						</th>
					</tr>
					<tr>
						<td>
							én
						</td>
						<td>
							<span class="hu">-ok</span>
						</td>
						<td>
							<span class="hu">-ek</span>
						</td>
						<td>
							<span class="hu">-ök</span>
						</td>
					</tr>
					<tr>
						<td>
							te
						</td>
						<td colspan="3">
							<span class="hu">-sz</span>
						</td>
					</tr>
					<tr>
						<td>
							ő
						</td>
						<td colspan="3">
							<span class="hu">(nothing)</span>
						</td>
					</tr>
					<tr>
						<td>
							mi
						</td>
						<td>
							<span class="hu">-unk</span>
						</td>
						<td colspan="2">
							<span class="hu">-ünk</span>
						</td>
					</tr>
					<tr>
						<td>
							ti
						</td>
						<td>
							<span class="hu">-tok</span>
						</td>
						<td colspan="2">
							<span class="hu">-tek</span>
						</td>
					</tr>
					<tr>
						<td>
							ők
						</td>
						<td>
							<span class="hu">-nak</span>
						</td>
						<td colspan="2">
							<span class="hu">-nek</span>
						</td>
					</tr>
				</table>
			</td>
			<td>
				<table border="1">
					<tr>
						<th rowspan="3">
							Person
						</th>
						<th colspan="3">
							Endings
						</th>
					</tr>
					<tr>
						<th rowspan="2">
							back
						</th>
						<th colspan="2">
							front
						</th>
					</tr>
					<tr>
						<th>
							short
						</th>
						<th>
							long
						</th>
					</tr>
					<tr>
						<td>
							én
						</td>
						<td>
							<span class="hu">-om</span>
						</td>
						<td>
							<span class="hu">-em</span>
						</td>
						<td>
							<span class="hu">-öm</span>
						</td>
					</tr>
					<tr>
						<td>
							te
						</td>
						<td>
							<span class="hu">-od</span>
						</td>
						<td>
							<span class="hu">-ed</span>
						</td>
						<td>
							<span class="hu">-öd</span>
						</td>
					</tr>
					<tr>
						<td>
							&#337;
						</td>
						<td>
							<span class="hu">-ja</span>
						</td>
						<td colspan="2">
							<span class="hu">-i</span>
						</td>
					</tr>
					<tr>
						<td>
							mi
						</td>
						<td>
							<span class="hu">-juk</span>
						</td>
						<td colspan="2">
							<span class="hu">-jük</span>
						</td>
					</tr>
					<tr>
						<td>
							ti
						</td>
						<td>
							<span class="hu">-játok</span>
						</td>
						<td colspan="2">
							<span class="hu">-itek</span>
						</td>
					</tr>
					<tr>
						<td>
							&#337;k
						</td>
						<td>
							<span class="hu">-ják</span>
						</td>
						<td colspan="2">
							<span class="hu">-ik</span>
						</td>
					</tr>
				</table>
			</td>
			<td>
				<table border="1">
					<tr>
						<th rowspan="3">
							Person
						</th>
						<th colspan="3">
							Endings
						</th>
					</tr>
					<tr>
						<th rowspan="2">
							back
						</th>
						<th colspan="2">
							front
						</th>
					</tr>
					<tr>
						<th>
							short
						</th>
						<th>
							long
						</th>
					</tr>
					<tr>
						<td>
							én
						</td>
						<td>
							<span class="hu">-<b>om</b></span>
						</td>
						<td>
							<span class="hu">-<b>em</b></span>
						</td>
						<td>
							<span class="hu">-<b>öm</b></span>
						</td>
					</tr>
					<tr>
						<td>
							te
						</td>
						<td colspan=3>
							<span class="hu">-sz</span>
						</td>
					</tr>
					<tr>
						<td>
							&#337;
						</td>
						<td colspan=3>
							<span class="hu">-<b>ik</b></span>
						</td>
					</tr>
					<tr>
						<td>
							mi
						</td>
						<td>
							<span class="hu">unk</span>
						</td>
						<td colspan=2>
							<span class="hu">ünk</span>
						</td>
					</tr>
					<tr>
						<td>
							ti
						</td>
						<td>
							<span class="hu">tok</span>
						</td>
						<td>
							<span class="hu">tek</span>
						</td>
						<td>
							<span class="hu">tök</span>
						</td>
					</tr>
					<tr>
						<td>
							&#337;k
						</td>
						<td>
							<span class="hu">nak</span>
						</td>
						<td colspan=2>
							<span class="hu">nek</span>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>

Actual Results:
|---------------------------------|
|header1   |  header2 |  header3  |
|          |          |  [whole ] |
|          |          |  [nested] |
|          |          |  [table ] |
|          |          |  [ 3 ]    |
|---------------------------------|
|[ whole ] | [ whole ]|           |
|[ nested] | [ nested]|           |
|[ table ] | [ table ]|           |
|[ 1     ] | [  2    ]|           |
|---------------------------------|


Expected Results:
|---------------------------------|
|header1   |  header2 |  header3  |
|---------------------------------|
|[ whole ] | [ whole ]|  [whole ] |
|[ nested] | [ nested]|  [nested] |
|[ table ] | [ table ]|  [table ] |
|[ 1     ] | [  2    ]|  [  3   ] |
|---------------------------------|



Reproducible: Always


User Profile Reset: No

Additional Info:
LibreOffice 7.5.7.1 (X86_64 )
Windows 10
Comment 1 Jan krynicky 2023-12-04 19:17:04 UTC
Created attachment 191234 [details]
An example html document
Comment 2 m_a_riosv 2023-12-05 00:57:25 UTC
Reproducible:
Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 43967453e15e1d054972a7586cfef8f8e0866270
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded