Mercurial Hosting > luan
comparison src/goodjava/html/Html.java @ 1800:a045f30fa67d
html fix
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 08 Mar 2024 10:24:00 -0700 |
parents | 31a82b0d0a87 |
children | 0288edd8f99b |
comparison
equal
deleted
inserted
replaced
1799:1578324d2aac | 1800:a045f30fa67d |
---|---|
130 if( containerTags.contains(tagName) ) { | 130 if( containerTags.contains(tagName) ) { |
131 Container container = parseContainer(tag); | 131 Container container = parseContainer(tag); |
132 if( container != null ) | 132 if( container != null ) |
133 el = container; | 133 el = container; |
134 } | 134 } |
135 if( el != null | 135 add(list,sb); |
136 || (el = parseComment()) != null | 136 list.add(el); |
137 || (el = parseCdata()) != null | 137 continue; |
138 ) { | 138 } else { |
139 Object el = parseComment(); | |
140 if( el == null ) | |
141 el = parseCdata(); | |
142 if( el != null ) { | |
139 add(list,sb); | 143 add(list,sb); |
140 list.add(el); | 144 list.add(el); |
141 continue; | 145 continue; |
142 } | 146 } |
143 } | 147 } |
164 while( !parser.test("-->") ) { | 168 while( !parser.test("-->") ) { |
165 if( !parser.anyChar() ) | 169 if( !parser.anyChar() ) |
166 return parser.failure(null); | 170 return parser.failure(null); |
167 } | 171 } |
168 String text = parser.textFrom(start); | 172 String text = parser.textFrom(start); |
173 parser.match("-->"); | |
169 Comment comment = new Comment(text); | 174 Comment comment = new Comment(text); |
170 return parser.success(comment); | 175 return parser.success(comment); |
171 } | 176 } |
172 | 177 |
173 private CData parseCdata() { | 178 private CData parseCdata() { |
178 while( !parser.test("]]>") ) { | 183 while( !parser.test("]]>") ) { |
179 if( !parser.anyChar() ) | 184 if( !parser.anyChar() ) |
180 return parser.failure(null); | 185 return parser.failure(null); |
181 } | 186 } |
182 String text = parser.textFrom(start); | 187 String text = parser.textFrom(start); |
188 parser.match("]]>"); | |
183 CData cdata = new CData(text); | 189 CData cdata = new CData(text); |
184 return parser.success(cdata); | 190 return parser.success(cdata); |
185 } | 191 } |
186 | 192 |
187 private Container parseContainer(Tag tag) { | 193 private Container parseContainer(Tag tag) { |