* Only append <br /> in res.writeln() if contentType is one of "text/html" or

"application/xhtml+xml". For any other content type, only an ordinary line
   break is appended to the line.
This commit is contained in:
hns 2005-09-16 09:11:13 +00:00
parent cd3fdb4fab
commit d0660ac1b5

View file

@ -295,7 +295,11 @@ public final class ResponseTrans implements Serializable {
buffer = new StringBuffer(INITIAL_BUFFER_SIZE); buffer = new StringBuffer(INITIAL_BUFFER_SIZE);
} }
buffer.append("<br />"); // only append <br> tag if we know this is an HTML/XHTML document.
// even then should we use <br> for HTML 4.0 and below. Well well well...
if ("text/html".equals(contentType) || "application/xhtml+xml".equals(contentType)) {
buffer.append("<br />");
}
buffer.append(newLine); buffer.append(newLine);
} }