Re: htdig: (Not) translating entities


Gilles Detillieux (grdetil@scrc.umanitoba.ca)
Tue, 12 Jan 1999 11:20:49 -0600 (CST)


Hi. I have a couple questions/comments about Marjolein's patch:

> *************** ConfigDefaults defaults[] =
> *** 168,173 ****
> --- 182,190 ----
> {"no_excerpt_show_top", "false"},
> {"no_next_page_text", "[next]"},
> {"no_prev_page_text", "[prev]"},
> + {"no_title_text", "[No title]"},
> //mk19990110
> + {"noindex_start", "<!--htdig_noindex-->"},
> //mk19990106
> + {"noindex_end", "<!--/htdig_noindex-->"},
> //mk19990106
> {"nothing_found_file", "${common_dir}/nomatch.html"},
> {"page_list_header", "<hr noshade size=2>Pages:<br>"},
> {"prefix_match_character", "*"},

You add these new attributes, but where are they used?

> *************** SGMLEntities::translateAndUpdate(unsigne
> *** 210,216 ****
> entity.length() < 10)
> {
> entity << *entityStart++;
> ! }
> if (entity.length() >= 10)
> {
> //
> --- 220,270 ----
> entity.length() < 10)
> {
> entity << *entityStart++;
> ! }
> !
> ! if ( !config.Boolean("translate_quot") )
> //mk19990111
> ! {
> //mk19990111
> ! //
> //mk19990111
> ! // Do NOT translate entities for '"' (quote).
> //mk19990111
> ! //
> //mk19990111
> ! if (entity.compare(new String("quot")) == 0 ||
> //mk19990111
> ! entity.compare(new String("#34")) == 0 )
> //mk19990111
> ! {
> //mk19990111
> ! entityStart = orig + 1;
> //mk19990111
> ! return '&';
> //mk19990111
> ! }
> //mk19990111
> ! }
> //mk19990111
> !
> ! if ( !config.Boolean("translate_amp") )
> //mk19990111
> ! {
> //mk19990111
> ! //
> //mk19990111
> ! // Do NOT translate entities for '&' since they can
> //mk19990111
> ! // occur in code samples that might end up in an excerpt.
> //mk19990111
> ! //
> //mk19990111
> ! if (entity.compare(new String("amp")) == 0 ||
> //mk19990111
> ! entity.compare(new String("#38")) == 0 )
> //mk19990111
> ! {
> //mk19990111
> ! entityStart = orig + 1;
> //mk19990111
> ! return '&';
> //mk19990111
> ! }
> //mk19990111
> ! }
> //mk19990111
> !
> ! if ( !config.Boolean("translate_lt_gt") )
> //mk19990111
> ! {
> //mk19990111
> ! //
> //mk19990111
> ! // Do NOT translate entities for '<' and '>' since they can
> //mk19990111
> ! // occur in code samples that might end up in an excerpt.
> //mk19990111
> ! //
> //mk19990111
> ! if (entity.compare(new String("lt")) == 0 ||
> //mk19990111
> ! entity.compare(new String("#60")) == 0 ||
> //mk19990111
> ! entity.compare(new String("gt")) == 0 ||
> //mk19990111
> ! entity.compare(new String("#62")) == 0 )
> //mk19990111
> ! {
> //mk19990111
> ! entityStart = orig + 1;
> //mk19990111
> ! return '&';
> //mk19990111
> ! }
> //mk19990111
> ! }
> //mk19990111
> !
> if (entity.length() >= 10)
> {
> //

Correct me if I'm wrong, but won't all these new String("blah") constructs
lead to major memory leaks in htdig? I think a better way of comparing the
entity String to a char * would be:
                if (strcmp(entity.get(), "blah") == 0)

-- 
Gilles R. Detillieux              E-mail: <grdetil@scrc.umanitoba.ca>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
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
htdig-request@sdsu.edu containing the single word "unsubscribe" in
the body of the message.



This archive was generated by hypermail 2.0b3 on Wed Jan 13 1999 - 09:13:06 PST