diff --git a/libs/minikin/LineBreaker.cpp b/libs/minikin/LineBreaker.cpp index f4201cb26b7..88190fff6f5 100644 --- a/libs/minikin/LineBreaker.cpp +++ b/libs/minikin/LineBreaker.cpp @@ -84,11 +84,12 @@ void LineBreaker::setIndents(const std::vector& indents) { } // This function determines whether a character is a space that disappears at end of line. -// It is the Unicode set: [[:General_Category=Space_Separator:]-[:Line_Break=Glue:]] +// It is the Unicode set: [[:General_Category=Space_Separator:]-[:Line_Break=Glue:]], +// plus '\n'. // Note: all such characters are in the BMP, so it's ok to use code units for this. static bool isLineEndSpace(uint16_t c) { - return c == ' ' || c == 0x1680 || (0x2000 <= c && c <= 0x200A && c != 0x2007) || c == 0x205F || - c == 0x3000; + return c == '\n' || c == ' ' || c == 0x1680 || (0x2000 <= c && c <= 0x200A && c != 0x2007) || + c == 0x205F || c == 0x3000; } // Ordinarily, this method measures the text in the range given. However, when paint