Re: [htdig] Description-problem

Gilles Detillieux (
Wed, 10 Mar 1999 13:40:35 -0600 (CST)

According to Geoff Hutchison:
> >tag in the index page. For whatever reason, htdig/ still collects
> >href tags and their description words when indexing is turned off, but
> >doesn't collect the spaces and punctuation between words in this case.
> >This seems inconsistent - it ought to collect either the whole description,
> >or none at all.
> I'm not sure why it's not collecting spaces and punctuation, I haven't
> looked at that code in a long while and I think it's changed since I last
> looked at it. However the behavior of picking up href tags on a noindex is
> completely correct.

All the handling of characters that are not part of a word is nested within
an if (doindex) { ... }, so when indexing is turned off, it doesn't collect
spaces and punctuation at all, not even for the descriptions. I figured
that the picking up of href tags was deliberate, but I didn't know if the
picking up of descriptions was or not. Don't the descriptions get indexed?

> >I couldn't figure out from the code why there was an empty slot in
> >$(DESCRIPTIONS). As far as I can see, it only adds empty descriptions
> >for tags like these:
> This would be a bug. Why should it add empty descriptions?

Well, when it calls got_href, and it doesn't have something sensible to
give it, it gives it an empty string. It seems AddDescription ought to
check for this, especially after stripping out leading & trailing space,
but right now it doesn't seem to.

> >Also, for whatever reason, htsearch seems to set $(DESCRIPTION) to the
> >second entry in the $(DESCRIPTIONS) list. I really don't know why that
> >is. Maybe the author of the code for that feature could shed some light.
> That particular line is a very bad hack. For one, it should create a new
> string to contain that value. I don't remember whether it was a patch or
> something I wrote very early in the morning. In any case, I'll see if I can
> whip up a patch for empty descriptions and this bug.

Oh, it does create a new string, but I couldn't figure out why it picks the
2nd element in the list returned by ref->Descriptions() as the value for that

Gilles R. Detillieux              E-mail: <>
Spinal Cord Research Centre       WWW:
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930
To unsubscribe from the htdig mailing list, send a message to containing the single word "unsubscribe" in
the SUBJECT of the message.

This archive was generated by hypermail 2.0b3 on Mon Mar 15 1999 - 08:57:46 PST