From bef6c7e4753df5f8904c87fefee168b2547a8f95 Mon Sep 17 00:00:00 2001 From: Manthan Date: Thu, 4 Jun 2020 09:41:31 +0530 Subject: [PATCH] fix: disabling PRN by default fixes #1976 fixes #1983 fixes #1977 --- bits/40_harb.js | 1 + xlsx.flow.js | 1 + xlsx.js | 1 + xlsx.mini.flow.js | 6 +++--- xlsx.mini.js | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bits/40_harb.js b/bits/40_harb.js index 77c44f3..8a619b6 100644 --- a/bits/40_harb.js +++ b/bits/40_harb.js @@ -865,6 +865,7 @@ var PRN = (function() { } function prn_to_sheet_str(str/*:string*/, opts)/*:Worksheet*/ { + if(!(opts && opts.PRN)) return dsv_to_sheet_str(str, opts); if(str.slice(0,4) == "sep=") return dsv_to_sheet_str(str, opts); if(str.indexOf("\t") >= 0 || str.indexOf(",") >= 0 || str.indexOf(";") >= 0) return dsv_to_sheet_str(str, opts); return aoa_to_sheet(prn_to_aoa_str(str, opts), opts); diff --git a/xlsx.flow.js b/xlsx.flow.js index ddbb1e2..f6b6807 100644 --- a/xlsx.flow.js +++ b/xlsx.flow.js @@ -7724,6 +7724,7 @@ var PRN = (function() { } function prn_to_sheet_str(str/*:string*/, opts)/*:Worksheet*/ { + if(!(opts && opts.PRN)) return dsv_to_sheet_str(str, opts); if(str.slice(0,4) == "sep=") return dsv_to_sheet_str(str, opts); if(str.indexOf("\t") >= 0 || str.indexOf(",") >= 0 || str.indexOf(";") >= 0) return dsv_to_sheet_str(str, opts); return aoa_to_sheet(prn_to_aoa_str(str, opts), opts); diff --git a/xlsx.js b/xlsx.js index 348635c..2835868 100644 --- a/xlsx.js +++ b/xlsx.js @@ -7626,6 +7626,7 @@ var PRN = (function() { } function prn_to_sheet_str(str, opts) { + if(!(opts && opts.PRN)) return dsv_to_sheet_str(str, opts); if(str.slice(0,4) == "sep=") return dsv_to_sheet_str(str, opts); if(str.indexOf("\t") >= 0 || str.indexOf(",") >= 0 || str.indexOf(";") >= 0) return dsv_to_sheet_str(str, opts); return aoa_to_sheet(prn_to_aoa_str(str, opts), opts); diff --git a/xlsx.mini.flow.js b/xlsx.mini.flow.js index 82d6984..c11dbbf 100644 --- a/xlsx.mini.flow.js +++ b/xlsx.mini.flow.js @@ -4,7 +4,7 @@ /*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */ var XLSX = {}; function make_xlsx_lib(XLSX){ -XLSX.version = '0.16.0'; +XLSX.version = '0.16.1'; var current_codepage = 1200, current_ansi = 1252; var VALID_ANSI = [ 874, 932, 936, 949, 950 ]; @@ -7531,8 +7531,8 @@ function parse_dom_table(table/*:HTMLElement*/, _opts/*:?any*/)/*:Worksheet*/ { for(_C = C = 0; _C < elts.length; ++_C) { var elt/*:HTMLTableCellElement*/ = elts[_C]; if (opts.display && is_dom_element_hidden(elt)) continue; - var v/*:string*/ = elt.hasAttribute('v') ? elt.getAttribute('v') : htmldecode(elt.innerHTML); - var z/*:string*/ = elt.getAttribute('z'); + var v/*:?string*/ = elt.hasAttribute('v') ? elt.getAttribute('v') : htmldecode(elt.innerHTML); + var z/*:?string*/ = elt.getAttribute('z'); for(midx = 0; midx < merges.length; ++midx) { var m/*:Range*/ = merges[midx]; if(m.s.c == C && m.s.r <= R && R <= m.e.r) { C = m.e.c+1; midx = -1; } diff --git a/xlsx.mini.js b/xlsx.mini.js index a996653..70c085e 100644 --- a/xlsx.mini.js +++ b/xlsx.mini.js @@ -4,7 +4,7 @@ /*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */ var XLSX = {}; function make_xlsx_lib(XLSX){ -XLSX.version = '0.16.0'; +XLSX.version = '0.16.1'; var current_codepage = 1200, current_ansi = 1252; var VALID_ANSI = [ 874, 932, 936, 949, 950 ];