Fix for bug 46306, html-to-plaintext replies have > on blank lines. The fix was to strip ending new lines in the citer. r=akkana, a=waterson.

This commit is contained in:
bratell%lysator.liu.se 2000-08-07 06:05:27 +00:00
Родитель 2a98211b4e
Коммит c487dfe193
4 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -5156,6 +5156,10 @@ nsHTMLEditor::InsertAsPlaintextQuotation(const nsString& aQuotedText,
if (!NS_SUCCEEDED(rv))
return rv;
// It's best to put a blank line after the quoted text so that mails
// written without thinking won't be so ugly.
quotedStuff.Append(PRUnichar('\n'));
nsCOMPtr<nsIDOMNode> preNode;
// get selection
nsCOMPtr<nsIDOMSelection> selection;

Просмотреть файл

@ -76,11 +76,21 @@ NS_IMETHODIMP
nsInternetCiter::GetCiteString(const nsString& aInString, nsString& aOutString)
{
PRUnichar newline ('\n'); // Not XP!
PRUnichar cr('\r');
PRInt32 i = 0;
PRInt32 length = aInString.Length();
aOutString.SetLength(0);
PRUnichar uch = newline;
// Strip trailing new lines which will otherwise turn up
// as ugly quoted empty lines.
while(length > 0 &&
(aInString[length-1] == cr ||
aInString[length-1] == newline))
{
--length;
}
// Loop over the string:
while (i < length)
{

Просмотреть файл

@ -5156,6 +5156,10 @@ nsHTMLEditor::InsertAsPlaintextQuotation(const nsString& aQuotedText,
if (!NS_SUCCEEDED(rv))
return rv;
// It's best to put a blank line after the quoted text so that mails
// written without thinking won't be so ugly.
quotedStuff.Append(PRUnichar('\n'));
nsCOMPtr<nsIDOMNode> preNode;
// get selection
nsCOMPtr<nsIDOMSelection> selection;

Просмотреть файл

@ -76,11 +76,21 @@ NS_IMETHODIMP
nsInternetCiter::GetCiteString(const nsString& aInString, nsString& aOutString)
{
PRUnichar newline ('\n'); // Not XP!
PRUnichar cr('\r');
PRInt32 i = 0;
PRInt32 length = aInString.Length();
aOutString.SetLength(0);
PRUnichar uch = newline;
// Strip trailing new lines which will otherwise turn up
// as ugly quoted empty lines.
while(length > 0 &&
(aInString[length-1] == cr ||
aInString[length-1] == newline))
{
--length;
}
// Loop over the string:
while (i < length)
{