diff options
Diffstat (limited to 'src/library/scala/xml/parsing/XhtmlParser.scala')
-rw-r--r-- | src/library/scala/xml/parsing/XhtmlParser.scala | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/src/library/scala/xml/parsing/XhtmlParser.scala b/src/library/scala/xml/parsing/XhtmlParser.scala index f644f5fb77..67482beb58 100644 --- a/src/library/scala/xml/parsing/XhtmlParser.scala +++ b/src/library/scala/xml/parsing/XhtmlParser.scala @@ -1,12 +1,24 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2003-2009, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + // $Id$ + package scala.xml.parsing -import scala.io.{Source} +import scala.io.Source -/** - * Extends the Markup Parser to do the right thing (tm) with PCData blocks. - * (c) David Pollak, 2007 WorldWide Conferencing, LLC +/** <p> + * Extends the Markup Parser to do the right thing (tm) with PCData blocks. + * </p> + * <p> + * (c) David Pollak, 2007 WorldWide Conferencing, LLC. + * </p> */ trait PCDataMarkupParser[PCM <: MarkupParser with MarkupHandler] extends MarkupParser { self: PCM => @@ -19,7 +31,7 @@ trait PCDataMarkupParser[PCM <: MarkupParser with MarkupHandler] extends MarkupP val pos1 = pos val sb: StringBuilder = new StringBuilder() while (true) { - if (ch==']' && + if (ch==']' && { sb.append(ch); nextch; ch == ']' } && { sb.append(ch); nextch; ch == '>' } ) { sb.setLength(sb.length - 2); @@ -33,18 +45,24 @@ trait PCDataMarkupParser[PCM <: MarkupParser with MarkupHandler] extends MarkupP } } -/** - * An XML Parser that preserves CDATA blocks and knows about HtmlEntities. - * (c) David Pollak, 2007 WorldWide Conferencing, LLC +/** <p> + * An XML Parser that preserves CDATA blocks and knows about HtmlEntities. + * </p> + * <p> + * (c) David Pollak, 2007 WorldWide Conferencing, LLC. + * </p> */ class XhtmlParser(val input: Source) extends ConstructingHandler with PCDataMarkupParser[XhtmlParser] with ExternalSources { val preserveWS = true ent ++= XhtmlEntities() } -/** - * Convenience method that instantiates, initializes and runs an XhtmlParser - * (c) Burak Emir +/** <p> + * Convenience method that instantiates, initializes and runs an XhtmlParser. + * </p> + * <p> + * (c) Burak Emir + * </p> */ object XhtmlParser { def apply(source: Source): NodeSeq = { |