35118: Fix from Daniel Bratell <bratell@lysator.liu.se> to fix signature delimiters in format=flowed

git-svn-id: svn://10.0.0.236/trunk@69929 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
akkana%netscape.com
2000-05-16 00:37:41 +00:00
parent 210e774dac
commit dec9c88f83
12 changed files with 120 additions and 6 deletions

View File

@@ -1132,10 +1132,19 @@ nsHTMLToTXTSinkStream::EndLine(PRBool softlinebreak)
}
if(mCurrentLine.Length()>0)
mEmptyLines=-1;
// Output current line
// Remove SPACE from the end of the line.
while(' ' == mCurrentLine[mCurrentLine.Length()-1])
// Remove SPACE from the end of the line, unless we got
// "-- " in a format=flowed output. "-- " is the sig delimiter
// by convention and shouldn't be touched even in format=flowed
// (see RFC 2646).
nsAutoString sig_delimiter;
sig_delimiter.AssignWithConversion("-- ");
while((' ' == mCurrentLine[mCurrentLine.Length()-1]) &&
((sig_delimiter != mCurrentLine) ||
!(mFlags & nsIDocumentEncoder::OutputFormatFlowed)))
mCurrentLine.SetLength(mCurrentLine.Length()-1);
mCurrentLine.AppendWithConversion(NS_LINEBREAK);
WriteSimple(mCurrentLine);
mCurrentLine.Truncate();