X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FHTML.java;h=022e7a0a30b6a54c450796b91724fdd1d0b9f04a;hb=d5f0e6ca91a3359b09352d3df367d6b6bd22f096;hp=b04b9d1a67b7b8a86e7ca65923b9b2b3f6f7dcd0;hpb=a4e5d96b632da36016ccbce16af6b094ed7b04b4;p=org.ibex.core.git diff --git a/src/org/xwt/HTML.java b/src/org/xwt/HTML.java index b04b9d1..022e7a0 100644 --- a/src/org/xwt/HTML.java +++ b/src/org/xwt/HTML.java @@ -1,28 +1,27 @@ // Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL] package org.xwt; -import org.xwt.util.*; import java.util.*; import java.net.*; import java.io.*; +import org.xwt.js.*; +import org.xwt.util.*; /* - While entities are limited to a subset of Unicode characters , - numeric character references can specify any character. Numeric - character references may be given in decimal or hexadecimal, though - browser support is stronger for decimal references. Decimal - references are of the form &#number; while hexadecimal references - take the case-insensitive form &#xnumber;. Examples of numeric - character references include © or © for the copyright - symbol, Α or Α for the Greek capital letter alpha, and - ا or ا for the Arabic letter ALEF. - - http://www.htmlhelp.com/reference/html40/entities/special.html - http://www.htmlhelp.com/reference/html40/entities/symbols.html - http://www.htmlhelp.com/reference/html40/entities/latin1.html - - FIXME FIXME FIXME:
  • tags close enclosing
  • tags -*/ + * While entities are limited to a subset of Unicode characters , + * numeric character references can specify any character. Numeric + * character references may be given in decimal or hexadecimal, though + * browser support is stronger for decimal references. Decimal + * references are of the form &#number; while hexadecimal references + * take the case-insensitive form &#xnumber;. Examples of numeric + * character references include © or © for the copyright + * symbol, Α or Α for the Greek capital letter alpha, and + * ا or ا for the Arabic letter ALEF. + * + * http://www.htmlhelp.com/reference/html40/entities/special.html + * http://www.htmlhelp.com/reference/html40/entities/symbols.html + * http://www.htmlhelp.com/reference/html40/entities/latin1.html + */ /** * This class parses an InputStream containing HTML and returns it @@ -47,10 +46,14 @@ public class HTML { /** we keep a StringBuffer around for use by removeRedundantWhitespace() */ private static StringBuffer sbuf = null; - public static synchronized JSObject parseReader(Reader r) throws IOException { + /** true iff we have encountered an LI more recently than the last OL/UL */ + private static boolean withinLI = false; + + public static synchronized JS parseReader(Reader r) throws IOException { CharStream cs = new CharStream(r); - JSObject h = new JSObject(); + JS.Obj h = new JS.Obj(); + withinLI = false; h.put("$name", "html"); try { @@ -59,11 +62,11 @@ public class HTML { // continue until we get an EOFException } - Object[] ids = h.getIds(); + Object[] ids = h.keys(); for(int i=0; i