/[classpath]/gjdoc/src/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer.java
ViewVC logotype

Diff of /gjdoc/src/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by julian, Tue Nov 23 17:19:48 2004 UTC revision 1.5 by julian, Thu Nov 25 14:40:20 2004 UTC
# Line 392  public final class HtmlRepairer { Line 392  public final class HtmlRepairer {
392    
393        StringBuffer buf = new StringBuffer();        StringBuffer buf = new StringBuffer();
394        char[] textAsChars = text.toCharArray();        char[] textAsChars = text.toCharArray();
395          
396       outer_loop:
397        for (int i=0, ilim=textAsChars.length+1; i<ilim; ++i) {        for (int i=0, ilim=textAsChars.length+1; i<ilim; ++i) {
398           int c;           int c;
399    
# Line 459  public final class HtmlRepairer { Line 460  public final class HtmlRepairer {
460                 state = STATE_INITIAL;                 state = STATE_INITIAL;
461                 continue;                 continue;
462              }              }
463                else {
464                   // peek forward and see whether this is a valid entity.
465                   if ('#'==c) {
466                      buf.append("&");
467                      buf.append((char)c);
468                      state = STATE_INITIAL;
469                      continue outer_loop;
470                   }
471                   else if (Character.isLetter((char)c)) {
472                      for (int i2=i+1; i2<ilim-1; i2++) {
473                         if (';' == textAsChars[i2]) {
474                            buf.append("&");
475                            buf.append((char)c);
476                            state = STATE_INITIAL;
477                            continue outer_loop;
478                         }
479                         else if (!Character.isLetter((char)c)
480                                  && !Character.isDigit((char)c)
481                                  && ".-_:".indexOf((char)c) < 0
482                                  //&& !isCombiningChar(c)  // FIXME
483                                  //&& !isExtender(c)       // FIXME
484                                  ) {
485                            break;
486                         }
487                      }
488                      // not a valid entity declaration; assume &amp;
489                   }
490                   buf.append("&amp;");
491                   buf.append((char)c);
492                   state = STATE_INITIAL;                  
493                }
494    
495                /*
496              else if ('#'==c || Character.isLetter((char)c)) {              else if ('#'==c || Character.isLetter((char)c)) {
497                 buf.append("&");                 buf.append("&");
498                 buf.append((char)c);                 buf.append((char)c);
# Line 469  public final class HtmlRepairer { Line 503  public final class HtmlRepairer {
503                 buf.append((char)c);                 buf.append((char)c);
504                 state = STATE_INITIAL;                           state = STATE_INITIAL;          
505              }              }
506                */
507              break;              break;
508                            
509           case STATE_TAG_START:           case STATE_TAG_START:

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26