Changeset 8d24696 for text.c


Ignore:
Timestamp:
Jun 26, 2003, 6:42:09 AM (21 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
4d42508
Parents:
e075479
Message:
Translate &lt; &gt; &amp; &quot; &nbsp; &ensp, &emsp, &endash and &emdash
File:
1 edited

Legend:

Unmodified
Added
Removed
  • text.c

    rab31454 r8d24696  
    135135char *owl_text_htmlstrip(char *in)
    136136{
    137   char *ptr1, *end, *ptr2, *ptr3, *out;
     137  char *ptr1, *end, *ptr2, *ptr3, *out, *out2;
    138138
    139139  out=owl_malloc(strlen(in)+30);
     
    150150    if (ptr2==NULL) {
    151151      strcat(out, ptr1);
    152       return(out);
     152      break;
    153153    }
    154154
     
    164164    if (!ptr3) {
    165165      strcat(out, ptr2);
    166       return(out);
     166      break;
    167167    }
    168168
     
    189189    ptr1=ptr3+1;
    190190  }
    191   return(out);
     191
     192  out2=owl_util_substitute(out, "&lt;", "<");
     193  owl_free(out);
     194  out=owl_util_substitute(out2, "&gt;", ">");
     195  owl_free(out2);
     196  out2=owl_util_substitute(out, "&amp;", "&");
     197  owl_free(out);
     198  out=owl_util_substitute(out2, "&quot;", "\"");
     199  owl_free(out2);
     200  out2=owl_util_substitute(out, "&nbsp;", " ");
     201  owl_free(out);
     202  out=owl_util_substitute(out2, "&ensp;", "  ");
     203  owl_free(out2);
     204  out2=owl_util_substitute(out, "&emsp;", "   ");
     205  owl_free(out);
     206  out=owl_util_substitute(out2, "&endash;", "--");
     207  owl_free(out2);
     208  out2=owl_util_substitute(out, "&emdash;", "---");
     209  owl_free(out);
     210
     211  return(out2);
    192212}
    193213
Note: See TracChangeset for help on using the changeset viewer.