Skip to content

Commit

Permalink
Strip quoted delims in file type magic 0x3C
Browse files Browse the repository at this point in the history
  • Loading branch information
ZaheerUdDeen committed Dec 5, 2021
1 parent fcf9182 commit 10ae7c9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bits/75_xlml.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ function parse_xlml_xml(d, _opts)/*:Workbook*/ {
else str = utf8read(str);
}
var opening = str.slice(0, 1024).toLowerCase(), ishtml = false;
opening = opening.replace(/".*?"/g, "");
if((opening.indexOf(">") & 1023) > Math.min((opening.indexOf(",") & 1023), (opening.indexOf(";")&1023))) { var _o = dup(opts); _o.type = "string"; return PRN.to_workbook(str, _o); }
if(opening.indexOf("<?xml") == -1) ["html", "table", "head", "meta", "script", "style", "div"].forEach(function(tag) { if(opening.indexOf("<" + tag) >= 0) ishtml = true; });
if(ishtml) return HTML_.to_workbook(str, opts);
Expand Down

0 comments on commit 10ae7c9

Please sign in to comment.