From 6e1475a2429b2088a4c0b322962fc584370653d9 Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Tue, 20 Dec 2016 14:40:36 +0800 Subject: Fix hyperlink missing after save issue and update completion row element logic to enhance compatibility. --- sheet.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sheet.go') diff --git a/sheet.go b/sheet.go index c0e9287..36488d5 100644 --- a/sheet.go +++ b/sheet.go @@ -116,11 +116,6 @@ func (f *File) setAppXML() { // declarations in a single element of a document. This function is a // horrible hack to fix that after the XML marshalling is completed. func replaceRelationshipsNameSpace(workbookMarshal string) string { - // newWorkbook := strings.Replace(workbookMarshal, `xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships:id`, `r:id`, -1) - // Dirty hack to fix issues #63 and #91; encoding/xml currently - // "doesn't allow for additional namespaces to be defined in the - // root element of the document," as described by @tealeg in the - // comments for #63. oldXmlns := `` newXmlns := `` return strings.Replace(workbookMarshal, oldXmlns, newXmlns, -1) @@ -129,6 +124,7 @@ func replaceRelationshipsNameSpace(workbookMarshal string) string { // replace relationships ID in worksheets/sheet%d.xml func replaceRelationshipsID(workbookMarshal string) string { rids := strings.Replace(workbookMarshal, ``, ``, -1) + rids = strings.Replace(rids, ``, ``, -1) return strings.Replace(rids, ``, ` />`, -1) workbookMarshal = strings.Replace(workbookMarshal, `>`, ` />`, -1) workbookMarshal = strings.Replace(workbookMarshal, `>`, ` />`, -1) + workbookMarshal = strings.Replace(workbookMarshal, `>`, ` />`, -1) return workbookMarshal } -- cgit v1.2.1