forked from sheetjs/sheetjs
handle internal links (fixes #145)
This commit is contained in:
parent
f9097d403b
commit
61b17e6d9d
@ -74,11 +74,15 @@ function parse_ws_xml_hlinks(s, data, rels) {
|
||||
for(var i = 0; i != data.length; ++i) {
|
||||
var val = parsexmltag(data[i], true);
|
||||
if(!val.ref) return;
|
||||
var rel = rels['!id'][val.id];
|
||||
var rel = rels ? rels['!id'][val.id] : null;
|
||||
if(rel) {
|
||||
val.Target = rel.Target;
|
||||
if(val.location) val.Target += "#"+val.location;
|
||||
val.Rel = rel;
|
||||
} else {
|
||||
val.Target = val.location;
|
||||
rel = {Target: val.location, TargetMode: 'Internal'};
|
||||
val.Rel = rel;
|
||||
}
|
||||
var rng = safe_decode_range(val.ref);
|
||||
for(var R=rng.s.r;R<=rng.e.r;++R) for(var C=rng.s.c;C<=rng.e.c;++C) {
|
||||
|
6
xlsx.js
6
xlsx.js
@ -2904,11 +2904,15 @@ function parse_ws_xml_hlinks(s, data, rels) {
|
||||
for(var i = 0; i != data.length; ++i) {
|
||||
var val = parsexmltag(data[i], true);
|
||||
if(!val.ref) return;
|
||||
var rel = rels['!id'][val.id];
|
||||
var rel = rels ? rels['!id'][val.id] : null;
|
||||
if(rel) {
|
||||
val.Target = rel.Target;
|
||||
if(val.location) val.Target += "#"+val.location;
|
||||
val.Rel = rel;
|
||||
} else {
|
||||
val.Target = val.location;
|
||||
rel = {Target: val.location, TargetMode: 'Internal'};
|
||||
val.Rel = rel;
|
||||
}
|
||||
var rng = safe_decode_range(val.ref);
|
||||
for(var R=rng.s.r;R<=rng.e.r;++R) for(var C=rng.s.c;C<=rng.e.c;++C) {
|
||||
|
Loading…
Reference in New Issue
Block a user