updating to 0.11.8

This commit is contained in:
SheetJS 2017-11-05 14:19:49 -05:00
parent 5ad2d6e47d
commit a2506aa8d3
4 changed files with 45 additions and 28 deletions

@ -1861,6 +1861,11 @@ describe('HTML', function() {
(domtest ? describe : describe.skip)('input DOM', function() {
it('should interpret values by default', function() { plaintext_test(X.utils.table_to_book(get_dom_element(html_str)), false, true); });
it('should generate strings if raw option is passed', function() { plaintext_test(X.utils.table_to_book(get_dom_element(html_str), {raw:true}), true, true); });
it('should handle newlines correctly', function() {
var table = get_dom_element("<table><tr><td>foo<br/>bar</td><td>baz</td></tr></table>");
var wb = X.utils.table_to_book(table);
assert.equal(get_cell(wb.Sheets.Sheet1, "A1").v, "foo\nbar");
});
});
});

6
xlsx.core.min.js vendored

File diff suppressed because one or more lines are too long

26
xlsx.full.min.js vendored

File diff suppressed because one or more lines are too long

36
xlsx.js

@ -4,7 +4,7 @@
/*global global, exports, module, require:false, process:false, Buffer:false */
var XLSX = {};
(function make_xlsx(XLSX){
XLSX.version = '0.11.7';
XLSX.version = '0.11.8';
var current_codepage = 1200;
/*global cptable:true */
if(typeof module !== "undefined" && typeof require !== 'undefined') {
@ -1026,7 +1026,7 @@ var DO_NOT_EXPORT_CFB = true;
/* [MS-CFB] v20130118 */
var CFB = (function _CFB(){
var exports = {};
exports.version = '0.13.2';
exports.version = '1.0.0';
/* [MS-CFB] 2.6.4 */
function namecmp(l, r) {
var L = l.split("/"), R = r.split("/");
@ -1129,16 +1129,15 @@ sector_list.fat_addrs = fat_addrs;
sector_list.ssz = ssz;
/* [MS-CFB] 2.6.1 Compound File Directory Entry */
var files = {}, Paths = [], FileIndex = [], FullPaths = [], FullPathDir = {};
read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex);
var files = {}, Paths = [], FileIndex = [], FullPaths = [];
read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, minifat_start);
build_full_paths(FileIndex, FullPathDir, FullPaths, Paths);
build_full_paths(FileIndex, FullPaths, Paths);
Paths.shift();
var o = {
FileIndex: FileIndex,
FullPaths: FullPaths,
FullPathDir: FullPathDir
FullPaths: FullPaths
};
// $FlowIgnore
@ -1190,7 +1189,7 @@ function sectorify(file, ssz) {
}
/* [MS-CFB] 2.6.4 Red-Black Tree */
function build_full_paths(FI, FPD, FP, Paths) {
function build_full_paths(FI, FP, Paths) {
var i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;
var dad = [], q = [];
@ -1226,10 +1225,23 @@ function build_full_paths(FI, FPD, FP, Paths) {
FP[0] += "/";
for(i=1; i < pl; ++i) {
if(FI[i].type !== 2 /* stream */) FP[i] += "/";
FPD[FP[i]] = FI[i];
}
}
function get_mfat_entry(entry, payload, mini) {
var start = entry.start, size = entry.size;
//return (payload.slice(start*MSSZ, start*MSSZ + size));
var o = [];
var idx = start;
while(mini && size > 0 && idx >= 0) {
o.push(payload.slice(idx * MSSZ, idx * MSSZ + MSSZ));
size -= MSSZ;
idx = __readInt32LE(mini, idx * 4);
}
if(o.length === 0) return (new_buf(0));
return (bconcat(o).slice(0, entry.size));
}
/** Chase down the rest of the DIFAT chain to build a comprehensive list
DIFAT chains by storing the next sector number as the last 32 bits */
function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {
@ -1291,7 +1303,7 @@ function make_sector_list(sectors, dir_start, fat_addrs, ssz) {
}
/* [MS-CFB] 2.6.1 Compound File Directory Entry */
function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex) {
function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {
var minifat_store = 0, pl = (Paths.length?2:0);
var sector = sector_list[dir_start].data;
var i = 0, namelen = 0, name;
@ -1333,7 +1345,7 @@ function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, Fil
} else {
o.storage = 'minifat';
if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {
o.content = (sector_list[minifat_store].data.slice(o.start*MSSZ,o.start*MSSZ+o.size));
o.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);
prep_blob(o.content, 0);
}
}
@ -2102,7 +2114,7 @@ var matchtag = (function() {
})();
function htmldecode(str) {
return str.trim().replace(/\s+/g, " ").replace(/<\s*[bB][rR]\s*\/?/g,"\n").replace(/<[^>]*>/g,"").replace(/&nbsp;/g, " ");
return str.trim().replace(/\s+/g, " ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,"").replace(/&nbsp;/g, " ");
}
var vtregex = (function(){ var vt_cache = {};