forked from SheetJS/sheetjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- read MSO HTML (fixes SheetJS#419 h/t @vineetl fixes SheetJS#458 h/t @tienne) - roll out xml namespace fix (closes SheetJS#362 h/t @PierreOCXP) - cellDates clarifications
- Loading branch information
1 parent
d2b5506
commit 7b6fb7b
Showing
38 changed files
with
286 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
XLSX.version = '0.8.7'; | ||
XLSX.version = '0.8.8'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* TODO: in browser attach to DOM; in node use an html parser */ | ||
function parse_html(str/*:string*/, opts)/*:Workbook*/ { | ||
var ws/*:Worksheet*/ = ({}/*:any*/); | ||
var o/*:Workbook*/ = { SheetNames: ["Sheet1"], Sheets: {Sheet1:ws} }; | ||
var i = str.indexOf("<table"), j = str.indexOf("</table"); | ||
if(i == -1 || j == -1) throw new Error("Invalid HTML: missing <table> / </table> pair"); | ||
var rows = str.slice(i, j).split(/<tr[^>]*>/); | ||
var R = 0, C = 0; | ||
var range = {s:{r:10000000, c:10000000},e:{r:0,c:0}}; | ||
for(i = 0; i < rows.length; ++i) { | ||
if(rows[i].substr(0,3) != "<td") continue; | ||
var cells = rows[i].split("</td>"); | ||
for(j = 0; j < cells.length; ++j) { | ||
if(cells[j].substr(0,3) != "<td") continue; | ||
++C; | ||
var m = cells[j], cc = 0; | ||
/* TODO: parse styles etc */ | ||
while(m.charAt(0) == "<" && (cc = m.indexOf(">")) > -1) m = m.slice(cc+1); | ||
while(m.indexOf(">") > -1) m = m.slice(0, m.lastIndexOf("<")); | ||
/* TODO: generate stub cells */ | ||
if(!m.length) continue; | ||
if(range.s.r > R) range.s.r = R; | ||
if(range.e.r < R) range.e.r = R; | ||
if(range.s.c > C) range.s.c = C; | ||
if(range.e.c < C) range.e.c = C; | ||
var coord/*:string*/ = encode_cell({r:R, c:C}); | ||
/* TODO: value parsing */ | ||
if(m == +m) ws[coord] = {t:'n', v:+m}; | ||
else ws[coord] = {t:'s', v:m}; | ||
} | ||
++R; C = 0; | ||
} | ||
ws['!ref'] = encode_range(range); | ||
return o; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.