Issue #1204 - recognize case insensitive properties. #1205

Closed
jjsquillante wants to merge 0 commits from master into master
jjsquillante commented 2018-08-07 00:11:02 +00:00 (Migrated from github.com)

As described in depth within issue #1204 - the function html_to_sheet only looks for a case-sensitive tag.colspan. PR aims set colspan property as lowercase during parsexmltag function to ensure property attributes are not set to object as uppercase.

Please let me know if there's any question! Thanks

As described in depth within issue #1204 - the function `html_to_sheet` only looks for a case-sensitive `tag.colspan`. PR aims set `colspan` property as lowercase during `parsexmltag` function to ensure property attributes are not set to `object` as uppercase. Please let me know if there's any question! Thanks
SheetJSDev commented 2018-08-07 00:57:27 +00:00 (Migrated from github.com)

The tests are failing because some of the actual checks in the code are case sensitive. There are two ways to proceed:

  1. go back and make every check case insensitive.

  2. expose both the case-sensitive and case-insensitive attributes:

--- a/bits/22_xmlutils.js
+++ b/bits/22_xmlutils.js
@@ -21,11 +21,13 @@ function parsexmltag(tag/*:string*/, skip_root/*:?boolean*/)/*:any*/ {
                if(j===q.length) {
                        if(q.indexOf("_") > 0) q = q.slice(0, q.indexOf("_")); // from ods
                        z[q] = v;
+                       z[q.toLowerCase()] = v;
                }
                else {
                        var k = (j===5 && q.slice(0,5)==="xmlns"?"xmlns":"")+q.slice(j+1);
                        if(z[k] && q.slice(j-3,j) == "ext") continue; // from ods
                        z[k] = v;
+                       z[k.toLowerCase()] = v;
                }
        }
        return z;
The tests are failing because some of the actual checks in the code are case sensitive. There are two ways to proceed: 1) go back and make every check case insensitive. 2) expose both the case-sensitive and case-insensitive attributes: ```diff --- a/bits/22_xmlutils.js +++ b/bits/22_xmlutils.js @@ -21,11 +21,13 @@ function parsexmltag(tag/*:string*/, skip_root/*:?boolean*/)/*:any*/ { if(j===q.length) { if(q.indexOf("_") > 0) q = q.slice(0, q.indexOf("_")); // from ods z[q] = v; + z[q.toLowerCase()] = v; } else { var k = (j===5 && q.slice(0,5)==="xmlns"?"xmlns":"")+q.slice(j+1); if(z[k] && q.slice(j-3,j) == "ext") continue; // from ods z[k] = v; + z[k.toLowerCase()] = v; } } return z; ```
jjsquillante commented 2018-08-07 18:49:52 +00:00 (Migrated from github.com)

thanks for the input! - I apologize for the confusion on the build and not seeing the tests failed ahead of time. :)

thanks for the input! - I apologize for the confusion on the build and not seeing the tests failed ahead of time. :)
SheetJSDev commented 2018-08-07 22:54:02 +00:00 (Migrated from github.com)

We also applied that to the bits file and pushed a commit attributed to you. Thank you very much for reporting!

P.S.: if you link the email from the commit to your github account, it will show you as a contributor

We also applied that to the bits file and pushed a commit attributed to you. Thank you very much for reporting! P.S.: if you link the email from the commit to your github account, it will show you as a contributor

Pull request closed

Sign in to join this conversation.
No description provided.