Minor fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6176 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-03-05 10:50:24 +00:00
parent 821bb1b0db
commit 772748f70a
2 changed files with 28 additions and 5 deletions

View file

@ -142,7 +142,7 @@
TYPE of reference, if implied, a reference to a label.
CLASS specific class for a method
-->
<!ELEMENT ref EMPTY>
<!ELEMENT ref (%text;)*>
<!ATTLIST ref
id CDATA #REQUIRED
type (class|protocol|method|function|type|macro|variable|label) "label"
@ -150,7 +150,7 @@
>
<!-- An e-mail address. -->
<!ELEMENT email EMPTY>
<!ELEMENT email (%text;)*>
<!ATTLIST email
address CDATA #IMPLIED
>
@ -162,7 +162,7 @@
>
<!-- A reference to a URL.
The text contained appears in the output unless
The text contained appears in the output.
-->
<!ELEMENT uref (%text;)*>
<!ATTLIST uref

View file

@ -389,6 +389,7 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt)
NSMutableString *text = [NSMutableString string];
NSString *name = [self getProp: "name" fromNode: node];
NSString *email = nil;
NSString *ename = nil;
NSString *url = nil;
NSString *desc = nil;
@ -401,6 +402,7 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt)
if (node != 0 && strcmp(node->name, "email") == 0)
{
email = [self getProp: "email" fromNode: node];
ename = [self parseText: node->childs];
node = node->next;
}
if (node != 0 && strcmp(node->name, "url") == 0)
@ -425,9 +427,10 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt)
}
if (email != nil)
{
if ([ename length] == 0)
ename = email;
[text appendFormat: @" (<a href=\"mailto:%@\"><code>%@</code></a>)\r\n",
email, email];
email, ename];
}
[text appendString: @"<dd>\r\n"];
if (desc != nil)
@ -1893,11 +1896,31 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt)
[text appendFormat: @" %@ ",
[self addLink: ref withText: @"see footnote"]];
}
else if (strcmp(node->name, "ref") == 0)
{
NSString *elem = [self parseText: node->childs];
NSString *typ = [self getProp: "type" fromNode: node];
// NSString *cls = [self getProp: "class" fromNode: node];
NSString *ref = [self getProp: "id" fromNode: node];
if ([elem length] == 0)
{
elem = ref;
}
if (typ == nil)
{
typ = @"label";
}
ref = [NSString stringWithFormat: @"%@-%@", typ, ref];
[text appendString: [self addLink: ref withText: elem]];
}
else if (strcmp(node->name, "uref") == 0)
{
NSString *elem = [self parseText: node->childs];
NSString *ref = [self getProp: "url" fromNode: node];
if ([elem length] == 0)
elem = ref;
[text appendFormat: @"<a href=\"%@\">%@</a>", ref, elem];
}
break;