From 8d864a5ea72d7a35a6ab94fa000784fa622c2d6c Mon Sep 17 00:00:00 2001 From: Evan Bovie Date: Tue, 13 Sep 2022 23:15:26 -0700 Subject: [PATCH] add display property to hyperlinks in 67_wsxml.js automatically sets display based on the cell's value per Excel behavior resolves an import issue with Google Sheets --- bits/67_wsxml.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bits/67_wsxml.js b/bits/67_wsxml.js index fe36787..e40175c 100644 --- a/bits/67_wsxml.js +++ b/bits/67_wsxml.js @@ -299,7 +299,10 @@ function write_ws_xml_cell(cell/*:Cell*/, ref, ws, opts/*::, idx, wb*/)/*:string var ff = cell.F && cell.F.slice(0, ref.length) == ref ? {t:"array", ref:cell.F} : null; v = writextag('f', escapexml(cell.f), ff) + (cell.v != null ? v : ""); } - if(cell.l) ws['!links'].push([ref, cell.l]); + if(cell.l) { + cell.l.display = escapexml(vv); + ws['!links'].push([ref, cell.l]); + } if(cell.D) o.cm = 1; return writextag('c', v, o); } @@ -609,6 +612,7 @@ function write_ws_xml(idx/*:number*/, opts, wb/*:Workbook*/, rels)/*:string*/ { } if((relc = l[1].Target.indexOf("#")) > -1) rel.location = escapexml(l[1].Target.slice(relc+1)); if(l[1].Tooltip) rel.tooltip = escapexml(l[1].Tooltip); + rel.display = l[1].display; o[o.length] = writextag("hyperlink",null,rel); }); o[o.length] = ""; -- 2.34.1