You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Workbook.prototype.substituteHyperlinks=function(sheetFilename,substitutions){letself=this;constsheetDirectory=path.dirname(sheetFilename),sheetName=path.basename(sheetFilename),relsFilename=sheetDirectory+"/"+'_rels'+"/"+sheetName+'.rels',relsFile=self.archive.file(relsFilename);etree.parse(self.archive.file(self.sharedStringsPath).asText()).getroot();if(relsFile===null){return;}constrels=etree.parse(relsFile.asText()).getroot();constrelationships=rels._children;constnewRelationships=[];relationships.forEach(function(relationship){newRelationships.push(relationship);if(relationship.attrib.Type===HYPERLINK_RELATIONSHIP){lettarget=relationship.attrib.Target;//Double-decode due to excel double encoding url placeholderstarget=decodeURI(decodeURI(target));self.extractPlaceholders(target).forEach(function(placeholder){constsubstitution=substitutions[placeholder.name];if(substitution===undefined){return;}target=target.replace(placeholder.placeholder,self.stringify(substitution));relationship.attrib.Target=encodeURI(target);});}});self.replaceChildren(rels,newRelationships);self.archive.file(relsFilename,etree.tostring(rels));};
Definition in v1.4.4
substituteHyperlinks(rels,substitutions){letself=this;etree.parse(self.archive.file(self.sharedStringsPath).asText()).getroot();if(rels===null){return;}constrelationships=rels.root._children;relationships.forEach(function(relationship){if(relationship.attrib.Type===HYPERLINK_RELATIONSHIP){lettarget=relationship.attrib.Target;//Double-decode due to excel double encoding url placeholderstarget=decodeURI(decodeURI(target));self.extractPlaceholders(target).forEach(function(placeholder){constsubstitution=substitutions[placeholder.name];if(substitution===undefined){return;}target=target.replace(placeholder.placeholder,self.stringify(substitution));relationship.attrib.Target=encodeURI(target);});}});}
In src/index.js
substituteHyperlinks(rels, substitutions) {
...
const relationships = rels.root._children;
...
}
In lib/index.ts
protected substituteHyperlinks(sheetFilename : any, substitutions : any) : void;
Definition in v1.0.0
Definition in v1.4.4
Trying to migrate from v1.0.0 to v1.4.4
The text was updated successfully, but these errors were encountered: