The Wayback Machine - https://web.archive.org/web/20200718021246/https://github.com/SheetJS/sheetjs/issues/1621
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading Excel HTML files will misalign cells in some cases #1621

Open
KurtMar opened this issue Sep 12, 2019 · 1 comment · May be fixed by #1684
Open

Reading Excel HTML files will misalign cells in some cases #1621

KurtMar opened this issue Sep 12, 2019 · 1 comment · May be fixed by #1684

Comments

@KurtMar
Copy link

@KurtMar KurtMar commented Sep 12, 2019

I noticed a bug in the html_to_sheet function. When reading cells that are empty, the cell index is correctly incremented, but if the cell has HTML tags and is observed to be empty after stripping the tags, the cell index is not incremented. This results in misalignment of the subsequent cells:

https://github.com/SheetJS/js-xlsx/blob/e3c5eac99c3b2be6929adfca455c1be87fab792b/xlsx.js#L18956-L18960

@SheetJSDev
Copy link
Member

@SheetJSDev SheetJSDev commented Sep 12, 2019

Thanks for reporting @KurtMar , indeed that line should be the same as the previous check. We'd accept a PR, please change the line in bits/79_html.js

Simple repro:

<table>
	<tr>
		<td>abc</td>
		<td><b> </b></td>
		<td>def</td>
	</tr>
<table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.