html-based excel file - failing to recognize merged columns due to case sensitive properties. #1204
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#1204
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Thanks for creating this open source library, it's helped save a good bit of my time!
Recently, I noticed when converting an html-based excel file:
There was a minor bug (seems similar but not related to issue #1187 ) while parsing out a merged column or
colspan
.Within the
html_to_sheet
(~line 18,081) function, we callparsexmltag
(defined ~line 2131, invoked ~18105) function and for each<TD>
look for a tag, slice at the equal sign, trim to get the attribute, and set the attribute as a property to an object.Once the
object
is returned to thetag
variable, we resume thehtml_to_sheet
function flow and setCS = tag.colspan ? +tag.colspan : 1
. This is where we possibly run into a case-sensitive issue withcolspan
. Unless thecolspan
property is lowercase, this will befalsy
andreturn 1
. In my case, the default attributes of this file are set and read as uppercase -COLSPAN
.I'm requesting a simple fix to uniformly set the attributes as lowercase properties before returning the
object
inparsexmltag
. I think the simplest solution is to chain.toLowerCase()
:Please let me know if you have any questions or need more information. I'm submitting a PR and sending test files/example in an email to sheetjs@gmail.com
Thanks!
James