mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +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
Notes:
sideshowbarker
2024-07-18 03:35:30 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/d9349f1510 Pull-request: https://github.com/SerenityOS/serenity/pull/23525 Reviewed-by: https://github.com/LucasChollet ✅
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…
Reference in a new issue