From 1ca49a50bd22d22f45196672a26f6262f5304b62 Mon Sep 17 00:00:00 2001 From: Evan Bovie Date: Fri, 23 Sep 2022 10:36:38 -0700 Subject: [PATCH] add display property to XLSX hyperlinks (#2791) Resolves import bug in 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] = "";