diff --git a/layout/generic/nsTextTransformer.cpp b/layout/generic/nsTextTransformer.cpp index 5c50168b1bab..466a4e6a99cb 100644 --- a/layout/generic/nsTextTransformer.cpp +++ b/layout/generic/nsTextTransformer.cpp @@ -300,7 +300,7 @@ nsTextTransformer::ScanNormalUnicodeText_F(PRBool aForLineBreak, if (CH_NBSP == ch) { ch = ' '; } - else if (IS_DISCARDED(ch)) { + else if (IS_DISCARDED(ch) || (ch == 0x0a) || (ch == 0x0d)) { // Strip discarded characters from the transformed output continue; } diff --git a/layout/html/base/src/nsTextTransformer.cpp b/layout/html/base/src/nsTextTransformer.cpp index 5c50168b1bab..466a4e6a99cb 100644 --- a/layout/html/base/src/nsTextTransformer.cpp +++ b/layout/html/base/src/nsTextTransformer.cpp @@ -300,7 +300,7 @@ nsTextTransformer::ScanNormalUnicodeText_F(PRBool aForLineBreak, if (CH_NBSP == ch) { ch = ' '; } - else if (IS_DISCARDED(ch)) { + else if (IS_DISCARDED(ch) || (ch == 0x0a) || (ch == 0x0d)) { // Strip discarded characters from the transformed output continue; }