2005-01-14 [colin] 0.9.13cvs33
[claws.git] / src / html.c
index fa32337d65595ffbb4606cca2d3ff21907c2c0b5..70407d5f02a9541f290fdae51c28ad186e3d9809 100644 (file)
@@ -413,8 +413,9 @@ gchar *html_parse(HTMLParser *parser)
                         * see the end anchor tag
                         */
                        if (HTML_HREF_BEG == st || HTML_HREF == st)
-                           return parser->str->str;
-                       } break;
+                               return parser->str->str;
+                       } 
+                       break;
                case '&':
                        html_parse_special(parser);
                        break;
@@ -734,68 +735,88 @@ static void html_parse_special(HTMLParser *parser)
                        parser->state = HTML_NORMAL;
                        return;
                } else {
-                   char *symb = NULL;
-                   switch (ch) {
-                   /* http://www.w3schools.com/html/html_entitiesref.asp */
-                   case 338:   /* capital ligature OE  Œ  */
-                       symb = "OE";  break;
-                   case 339:   /* small ligature OE    œ  */
-                       symb = "oe";  break;
-                   case 352:   /* capital S w/caron    Š */
-                   case 353:   /* small S w/caron      š */
-                   case 376:   /* cap Y w/ diaeres     Ÿ   */
-                       break;
-                   case 710:   /* circumflex accent    ˆ   */
-                       symb = "^";  break;
-                   case 732:   /* small tilde          ˜  */
-                       symb = "~";  break;
-                   case 8194:  /* en space                 */
-                   case 8195:  /* em space                 */
-                   case 8201:  /* thin space             */
-                       symb = " ";  break;
-                   case 8204:  /* zero width non-joiner ‌  */
-                   case 8205:  /* zero width joiner    ‍    */
-                   case 8206:  /* l-t-r mark           ‎    */
-                   case 8207:  /* r-t-l mark           &rlm     */
-                       break;
-                   case 8211:  /* en dash              –  */
-                       symb = "-";  break;
-                   case 8212:  /* em dash              —  */
-                       symb = "--";  break;
-                   case 8216:  /* l single quot mark   ‘  */
-                       symb = "`";  break;
-                   case 8217:  /* r single quot mark   ’  */
-                       symb = "'";  break;
-                   case 8218:  /* single low-9 quot    ‚  */
-                       symb = ",";  break;
-                   case 8220:  /* l double quot mark   “  */
-                       symb = "``";  break;
-                   case 8221:  /* r double quot mark   ”  */
-                       symb = "''";  break;
-                   case 8222:  /* double low-9 quot    „  */
-                       symb = ",,";  break;
-                   case 8224:  /* dagger               † */
-                   case 8225:  /* double dagger        ‡ */
-                       break;
-                   case 8230:  /* horizontal ellipsis  … */
-                       symb = "...";  break;
-                   case 8240:  /* per mile             ‰ */
-                       symb = "\%o";  break;
-                   case 8249:  /* l-pointing angle quot ‹ */
-                       symb = "<";  break;
-                   case 8250:  /* r-pointing angle quot &rsaquo; */
-                       symb = ">";  break;
-                   case 8364:  /* euro                 &euro;   */
-                       symb = "&euro";  break;
-                   case 8482:  /* trademark            &trade;  */
-                       symb  = "(TM)";  break;
-                   default: break;
-                   }
-                   if (symb) {
-                       html_append_str(parser, symb, -1);
-                       parser->state = HTML_NORMAL;
-                       return;
-                   }
+                       char *symb = NULL;
+                       switch (ch) {
+                       /* http://www.w3schools.com/html/html_entitiesref.asp */
+                       case 338:       /* capital ligature OE  &OElig;  */
+                               symb = "OE";  
+                               break;
+                       case 339:       /* small ligature OE    &oelig;  */
+                               symb = "oe";  
+                               break;
+                       case 352:       /* capital S w/caron    &Scaron; */
+                       case 353:       /* small S w/caron      &scaron; */
+                       case 376:       /* cap Y w/ diaeres     &Yuml;   */
+                               break;
+                       case 710:       /* circumflex accent    &circ;   */
+                               symb = "^";  
+                               break;
+                       case 732:       /* small tilde          &tilde;  */
+                               symb = "~";  
+                               break;
+                       case 8194:      /* en space             &ensp;   */
+                       case 8195:      /* em space             &emsp;   */
+                       case 8201:      /* thin space           &thinsp; */
+                               symb = " ";  
+                               break;
+                       case 8204:      /* zero width non-joiner &zwnj;  */
+                       case 8205:      /* zero width joiner    &zwj;   */
+                       case 8206:      /* l-t-r mark           &lrm;   */
+                       case 8207:      /* r-t-l mark           &rlm     */
+                               break;
+                       case 8211:      /* en dash              &ndash;  */
+                               symb = "-";  
+                               break;
+                       case 8212:      /* em dash              &mdash;  */
+                               symb = "--";  
+                               break;
+                       case 8216:      /* l single quot mark   &lsquo;  */
+                               symb = "`";  
+                               break;
+                       case 8217:      /* r single quot mark   &rsquo;  */
+                               symb = "'";  
+                               break;
+                       case 8218:      /* single low-9 quot    &sbquo;  */
+                               symb = ",";  
+                               break;
+                       case 8220:      /* l double quot mark   &ldquo;  */
+                               symb = "``";  
+                               break;
+                       case 8221:      /* r double quot mark   &rdquo;  */
+                               symb = "''";  
+                               break;
+                       case 8222:      /* double low-9 quot    &bdquo;  */
+                               symb = ",,";  
+                               break;
+                       case 8224:      /* dagger               &dagger; */
+                       case 8225:      /* double dagger        &Dagger; */
+                               break;
+                       case 8230:      /* horizontal ellipsis  &hellip; */
+                               symb = "...";  
+                               break;
+                       case 8240:      /* per mile             &permil; */
+                               symb = "\%o";  
+                               break;
+                       case 8249:      /* l-pointing angle quot &lsaquo; */
+                               symb = "<";  
+                               break;
+                       case 8250:      /* r-pointing angle quot &rsaquo; */
+                               symb = ">";  
+                               break;
+                       case 8364:      /* euro                 &euro;   */
+                               symb = "EUR";  
+                               break;
+                       case 8482:      /* trademark            &trade;  */
+                               symb  = "(TM)";  
+                               break;
+                       default: 
+                               break;
+                       }
+                       if (symb) {
+                               html_append_str(parser, symb, -1);
+                               parser->state = HTML_NORMAL;
+                               return;
+                       }
                }
        }