Text after a <br> tag within a <th> tag gets truncated when converting an HTML document to a Workbook

Hi Support Team,

Aspose Cells for Java version: 21.3

When creating a workbook by passing an HTML document to the constructor, any text after a <br> tag within a <th> tag is truncated. Text in <td> tags is parsed correctly.

Workbook workbook = new Workbook("test.html");
workbook.save("test.xlsx");

test.html:

<html>
<head></head>
<body>
	<table border="1">
		<thead>
			<tr>
				<th>One line heading</th>
				<th>Two line<br>heading</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>One line data</td>
				<td>Two line<br> data</td>
			</tr>
			<tr>
				<td>Two line<br> data</td>
				<td>One line data</td>
			</tr>
		</tbody>
	</table>
</body>
</html>

Attached are two images:

  1. test.html rendered in a browser
  2. The contents of text.xlsx

html_output_in_browser.jpg (11.2 KB)
generated_xlsx_content.jpg (27.6 KB)

Any advice would be appreciated!

@mclark,

Please notice, I am able to reproduce the issue as you mentioned by your mentioned HTML. I found Text after a “<br>” tag within a “<th>” tag gets truncated when converting an HTML document to a Excel file. I have logged a ticket with an id “CELLSJAVA-43470” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

@mclark,
Please try our latest version/fix: Aspose.Cells for Java v21.5.5 (attached)
aspose-cells-21.5.5-java.zip (7.3 MB)

Your issue should be fixed now.
Let us know your feedback.

Perfect! Works just fine now. Many thanks for the quick turnaround.

@mclark,

Good to know that your are up and running again. In the event of further queries or comments, feel free to write us back.

The issues you have found earlier (filed as CELLSJAVA-43470) have been fixed in this update.