Skip to content

Commit

Permalink
Fixed a problem with malformed XHTML output
Browse files Browse the repository at this point in the history
  • Loading branch information
dpp committed Jun 1, 2011
1 parent bb9b8a1 commit 9c51c3b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions web/webkit/src/main/scala/net/liftweb/http/HtmlProperties.scala
Expand Up @@ -295,14 +295,14 @@ final case class OldHtmlProperties(userAgent: Box[String]) extends HtmlPropertie
(docType -> encoding) match {
case (Full(dt), Full(enc)) if dt.length > 0 && enc.length > 0 =>
if (LiftRules.calcIE6ForResponse() && LiftRules.flipDocTypeForIE6) {
Full(dt + "\n" + enc + "\n")
Full(dt.trim + "\n" + enc.trim + "\n")
} else {
Full(enc + "\n" + dt + "\n")
Full(enc.trim + "\n" + dt.trim + "\n")
}

case (Full(dt), _) if dt.length > 0 => Full(dt + "\n")
case (Full(dt), _) if dt.length > 0 => Full(dt.trim + "\n")

case (_, Full(enc)) if enc.length > 0=> Full(enc + "\n")
case (_, Full(enc)) if enc.length > 0=> Full(enc.trim + "\n")

case _ => Empty
}
Expand Down Expand Up @@ -334,7 +334,7 @@ final case class Html5Properties(userAgent: Box[String]) extends HtmlProperties
def htmlWriter: (Node, Writer) => Unit =
Html5.write(_, _, false, !LiftRules.convertToEntity.vend)

def htmlOutputHeader: Box[String] = docType.map(_ + "\n")
def htmlOutputHeader: Box[String] = docType.map(_.trim + "\n")

val html5FormsSupport: Boolean = {
val r = S.request openOr Req.nil
Expand Down

0 comments on commit 9c51c3b

Please sign in to comment.