mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 05:54:58 +00:00
LibGfx: Treat "\r\n" as a single line break during text layout
We currently insert two line breaks for this sequence. This Windows- style of line breaking can be seen in documents on the web.
This commit is contained in:
parent
4bdb7dba8c
commit
d9349f1510
1 changed files with 5 additions and 2 deletions
|
@ -73,8 +73,11 @@ Vector<ByteString, 32> TextLayout::wrap_lines(TextElision elision, TextWrapping
|
|||
|
||||
continue;
|
||||
}
|
||||
case '\n':
|
||||
case '\r': {
|
||||
case '\r':
|
||||
if (it.peek(1) == static_cast<u32>('\n'))
|
||||
++it;
|
||||
[[fallthrough]];
|
||||
case '\n': {
|
||||
if (current_block_type.has_value()) {
|
||||
blocks.append({
|
||||
current_block_type.value(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue