/[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.5 by julian, Thu Nov 25 14:40:20 2004 UTC revision 1.6 by julian, Fri Dec 10 14:47:01 2004 UTC
# Line 59  public final class HtmlRepairer { Line 59  public final class HtmlRepairer {
59     private MemberDoc contextMember;     private MemberDoc contextMember;
60     private StringBuffer output = new StringBuffer();     private StringBuffer output = new StringBuffer();
61     private Stack tagStack = new Stack();     private Stack tagStack = new Stack();
62       private boolean isLeadingTag = true;
63       private boolean throwAwayLeadingPara = false;
64    
65     private static Map tagInfoMap;     private static Map tagInfoMap;
66    
# Line 75  public final class HtmlRepairer { Line 77  public final class HtmlRepairer {
77    
78     public HtmlRepairer(DocErrorReporter warningReporter,     public HtmlRepairer(DocErrorReporter warningReporter,
79                         boolean noWarn, boolean noEmailWarn,                         boolean noWarn, boolean noEmailWarn,
80                         ClassDoc contextClass, MemberDoc contextMember) {                         ClassDoc contextClass, MemberDoc contextMember,
81                           boolean throwAwayLeadingPara) {
82        this.warningReporter = warningReporter;        this.warningReporter = warningReporter;
83        this.noWarn = noWarn;        this.noWarn = noWarn;
84        this.noEmailWarn = noEmailWarn;        this.noEmailWarn = noEmailWarn;
85        this.contextClass = contextClass;        this.contextClass = contextClass;
86        this.contextMember = contextMember;        this.contextMember = contextMember;
87          this.throwAwayLeadingPara = throwAwayLeadingPara;
88     }     }
89        
90     private static String replaceStr(String haystack, String needle, String replacement) {     private static String replaceStr(String haystack, String needle, String replacement) {
# Line 94  public final class HtmlRepairer { Line 98  public final class HtmlRepairer {
98    
99     private void haveText(String text) {     private void haveText(String text) {
100    
101          if (isLeadingTag && throwAwayLeadingPara) {
102             if (0 != text.trim().length()) {
103                isLeadingTag = false;
104             }
105          }
106    
107        text = replaceStr(text, "&lt1", "<1");        text = replaceStr(text, "&lt1", "<1");
108        text = replaceStr(text, "&&", "&&");        text = replaceStr(text, "&&", "&&");
109        text = replaceStr(text, "& ", "& ");        text = replaceStr(text, "& ", "& ");
# Line 108  public final class HtmlRepairer { Line 118  public final class HtmlRepairer {
118    
119     private void haveStartOrEndTag(String tag) {     private void haveStartOrEndTag(String tag) {
120    
121          boolean _isLeadingTag = isLeadingTag;
122          isLeadingTag = false;
123    
124        tag = tag.trim();        tag = tag.trim();
125    
126        boolean isEndTag = tag.startsWith("/");        boolean isEndTag = tag.startsWith("/");
# Line 144  public final class HtmlRepairer { Line 157  public final class HtmlRepairer {
157        }        }
158    
159        tagName = tagName.toLowerCase();        tagName = tagName.toLowerCase();
160    
161          if (_isLeadingTag && "p".equals(tagName) && !isEndTag && throwAwayLeadingPara) {
162             return;
163          }
164    
165        if ("p".equals(tagName) || "br".equals(tagName) || "hr".equals(tagName)) {        if ("p".equals(tagName) || "br".equals(tagName) || "hr".equals(tagName)) {
166           // throw away </p> and </br>           // throw away </p> and </br>
167           if (isEndTag) {           if (isEndTag) {

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

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