Subversion Repositories wimsdev

Rev

Rev 15588 | Rev 17177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15588 Rev 16080
Line 1442... Line 1442...
1442
{
1442
{
1443
  if(check_parentheses(p,1)==0)
1443
  if(check_parentheses(p,1)==0)
1444
    ovlstrcpy(p, "yes");
1444
    ovlstrcpy(p, "yes");
1445
  else ovlstrcpy(p, "no");
1445
  else ovlstrcpy(p, "no");
1446
}
1446
}
1447
/* remove html tag, very rudimentary. */
1447
/* remove html tag, very rudimentary.
-
 
1448
  by default, everything is detagged
-
 
1449
  one can choose what to detag by the parameter wims_parm_detag
-
 
1450
*/
1448
void calc_detag(char *p)
1451
void calc_detag(char *p)
1449
{
1452
{
1450
  char *p1, *p2;
1453
  char *p1, *p2, *s, tag[100];
-
 
1454
  int n=0;
-
 
1455
 
-
 
1456
  s=getvar("wims_parm_detag");
-
 
1457
  if(s==NULL || *s == 0)
1451
  for(p1=strchr(p,'<'); p1!=NULL; p1=strchr(p1,'<')) {
1458
    for(p1=strchr(p,'<'); p1!=NULL; p1=strchr(p1,'<'))
-
 
1459
      {
1452
    p2=strchr(p1,'>'); if(p2==NULL) p1++;
1460
        p2=strchr(p1,'>');
-
 
1461
        if(p2==NULL) p1++; else ovlstrcpy(p1,p2+1);
-
 
1462
      }
-
 
1463
  else
-
 
1464
    for(s=find_word_start(s); *s; s=find_word_start(s+n))
-
 
1465
    {
-
 
1466
      n = find_word_end(s) - s; if (n > 96) n = 96;
-
 
1467
      tag[0]='<';
-
 
1468
      mystrncpy(tag+1, s, n+1); tag[n+1]=0;
-
 
1469
      for(p1=strstr(p,tag); p1!=NULL; p1=strstr(p1,tag))
-
 
1470
      {
1453
  else ovlstrcpy(p1,p2+1);
1471
        p2=strchr(p1,'>');
-
 
1472
        if(p2==NULL) p1++; else ovlstrcpy(p1,p2+1);
-
 
1473
      }
-
 
1474
      tag[1]='/';
-
 
1475
      mystrncpy(tag+2, s, n+1); tag[n+2]='>'; tag[n+3]=0;
-
 
1476
      for(p1=strstr(p,tag); p1!=NULL; p1=strstr(p1,tag))
-
 
1477
        ovlstrcpy(p1,p1+strlen(tag));
1454
  }
1478
    }
1455
}
1479
}
1456
 
1480
 
1457
/* replace html symbols by their iso translation */
1481
/* replace html symbols by their iso translation */
1458
void calc_html2iso(char *p)
1482
void calc_html2iso(char *p)
1459
{
1483
{