handle internal links (fixes #145)

This commit is contained in:
harbhub 2014-11-13 03:42:15 -05:00
parent f9097d403b
commit 61b17e6d9d
2 changed files with 10 additions and 2 deletions

@ -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) {

@ -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) {