Branch: Tag:

1997-12-23

1997-12-23 11:13:28 by Per Hedbor <ph@opera.com>

Julhack

Rev: server/base_server/roxenlib.pike:1.41
Rev: server/languages/portuguese.pike:1.6
Rev: server/modules/graphics/graphic_text.pike:1.95
Rev: server/modules/tags/htmlparse.pike:1.58

1: - constant cvs_version="$Id: graphic_text.pike,v 1.94 1997/12/19 17:41:37 grubba Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.95 1997/12/23 11:13:25 per Exp $";   constant thread_safe=1;      #include <module.h>
629:      mapping find_cached_args(int num);    - constant nbsp = sprintf("%c",160); + constant nbsp = iso88591["&nbsp;"];    -  + constant replace_from = indices( iso88591 )+ ({"&ss;","&lt;","&gt;","&amp",}); + constant replace_to = values( iso88591 ) + ({ nbsp, "<", ">", "&", }); +  + #define simplify_text( from ) replace(from,replace_from,replace_to) +    array(int)|string write_text(int _args, string text, int size,    object id)   {
648:       if(!args->verbatim)    { -  text = replace(text, nbsp, "&nbsp;"); -  text = replace(text,({ "&nbsp;","&ss;","&lt;","&gt;","&amp;"}), -  ({" ",nbsp,"<", ">", "&" })); +  text = replace(text, nbsp, " "); +  text = simplify_text( text );    string res="",nspace="",cspace="";    foreach(text/"\n", string line)    {