24912: Flush the current line when entering a pre tag. r=cmanske
git-svn-id: svn://10.0.0.236/trunk@59553 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -515,8 +515,9 @@ nsHTMLToTXTSinkStream::OpenContainer(const nsIParserNode& aNode)
|
||||
if (!DoOutput())
|
||||
return NS_OK;
|
||||
|
||||
if (type == eHTMLTag_p)
|
||||
if (type == eHTMLTag_p || type == eHTMLTag_pre)
|
||||
EnsureVerticalSpace(1); // Should this be 0 in unformatted case?
|
||||
|
||||
// Else make sure we'll separate block level tags,
|
||||
// even if we're about to leave before doing any other formatting.
|
||||
// Oddly, I can't find a case where this actually makes any difference.
|
||||
@@ -579,10 +580,6 @@ nsHTMLToTXTSinkStream::OpenContainer(const nsIParserNode& aNode)
|
||||
else
|
||||
mIndent += gTabSize; // Check for some maximum value?
|
||||
}
|
||||
else if (type == eHTMLTag_pre)
|
||||
{
|
||||
EnsureVerticalSpace(1);
|
||||
}
|
||||
else if (type == eHTMLTag_a)
|
||||
{
|
||||
nsAutoString url;
|
||||
@@ -1149,6 +1146,8 @@ nsHTMLToTXTSinkStream::Write(const nsString& aString)
|
||||
|
||||
NS_WARN_IF_FALSE(mCurrentLine.Length() == 0,
|
||||
"Mixed wrapping data and nonwrapping data on the same line");
|
||||
if (mCurrentLine.Length() > 0)
|
||||
FlushLine();
|
||||
|
||||
// Put the mail quote "> " chars in, if appropriate.
|
||||
// Have to put it in before every line.
|
||||
|
||||
Reference in New Issue
Block a user