pike.git / src / modules / Image / mkwmml.pike

version» Context lines:

pike.git/src/modules/Image/mkwmml.pike:1: - /* $Id: mkwmml.pike,v 1.3 1997/11/10 13:30:02 mirar Exp $ */ + /* $Id: mkwmml.pike,v 1.4 1997/11/10 14:19:56 mirar Exp $ */      import Stdio;   import Array;      mapping parse=([]);   int illustration_counter;      #define error(X) throw( ({ (X), backtrace()[0..sizeof(backtrace())-2] }) )      /*
pike.git/src/modules/Image/mkwmml.pike:177:    while (sscanf(s,"%s<%s>%s",u,v,s)==3)    t+=HTMLIFY(u)+"<"+v+">";    return t+HTMLIFY(s);   }      #define linkify(S) (replace((S),({"->","()"}),({".",""})))      string make_nice_reference(string what,string prefix)   {    string q; -  if (search(what,".")==-1 && +  if (what==prefix[strlen(prefix)-strlen(what)-2..strlen(prefix)-3]) +  { +  q=prefix[0..strlen(prefix)-3]; +  } +  else if (what==prefix[strlen(prefix)-strlen(what)-1..strlen(prefix)-2]) +  { +  q=prefix[0..strlen(prefix)-2]; +  } +  else if (search(what,".")==-1 &&    search(what,"->")==-1 && -  !parse[what] && -  what!=prefix[strlen(prefix)-strlen(what)-2..strlen(prefix)-3] && -  what!=prefix[strlen(prefix)-strlen(what)-1..strlen(prefix)-2]) +  !parse[what])    {    q=prefix+what;    }    else    q=what;       return "<link to="+linkify(q)+">"+what+"</link>";   }      string fixdesc(string s,string prefix,string where)