mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix local anchor bug.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11767 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3769295b89
commit
ed25d4ea76
1 changed files with 10 additions and 8 deletions
|
@ -150,17 +150,18 @@ static NSMutableSet *textNodes = nil;
|
|||
{
|
||||
NSString *s;
|
||||
NSString *kind = (f == YES) ? @"href" : @"name";
|
||||
NSString *hash = (f == YES) ? @"#" : @"";
|
||||
|
||||
if (f == NO || (s = [localRefs globalRef: r type: t]) != nil)
|
||||
{
|
||||
s = [NSString stringWithFormat: @"<a %@=\"#%@$%@\">",
|
||||
kind, t, r];
|
||||
s = [NSString stringWithFormat: @"<a %@=\"%@%@$%@\">",
|
||||
kind, hash, t, r];
|
||||
}
|
||||
else if ((s = [globalRefs globalRef: r type: t]) != nil)
|
||||
{
|
||||
s = [s stringByAppendingPathExtension: @"html"];
|
||||
s = [NSString stringWithFormat: @"<a %@=\"%@#%@$%@\">",
|
||||
kind, s, t, r];
|
||||
s = [NSString stringWithFormat: @"<a %@=\"%@%@%@$%@\">",
|
||||
kind, s, hash, t, r];
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
@ -183,6 +184,7 @@ static NSMutableSet *textNodes = nil;
|
|||
NSString *s = nil;
|
||||
BOOL isLocal = YES;
|
||||
NSString *kind = (f == YES) ? @"href" : @"name";
|
||||
NSString *hash = (f == YES) ? @"#" : @"";
|
||||
|
||||
/*
|
||||
* No unit specified ... try to infer it.
|
||||
|
@ -255,14 +257,14 @@ static NSMutableSet *textNodes = nil;
|
|||
{
|
||||
if (isLocal == YES)
|
||||
{
|
||||
s = [NSString stringWithFormat: @"<a %@=\"#%@%@\">",
|
||||
kind, u, r];
|
||||
s = [NSString stringWithFormat: @"<a %@=\"%@%@%@\">",
|
||||
kind, hash, u, r];
|
||||
}
|
||||
else
|
||||
{
|
||||
s = [s stringByAppendingPathExtension: @"html"];
|
||||
s = [NSString stringWithFormat: @"<a %@=\"%@#%@%@\">",
|
||||
kind, s, u, r];
|
||||
s = [NSString stringWithFormat: @"<a %@=\"%@%@%@%@\">",
|
||||
kind, s, hash, u, r];
|
||||
}
|
||||
}
|
||||
return s;
|
||||
|
|
Loading…
Reference in a new issue