mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:47:44 +00:00
LibWeb: Fix inline blocks swallowing trailing whitespace
In #10434 an issue with leading whitespace in new lines after a <br> element was fixed by checking whether the last fragment of LineBox is empty. However, this introduced a regression by which whitespace following inline elements was swallowed, so `<b>Test</b> 123` would appear like `Test123`. By asking specifically if we are handling a forced linebreak instead of implicity asking for a property that may be shared by other Node types, we can maintain the correct behavior in regards to leading whitespace on new lines, as well as trailing whitespace of inline elements.
This commit is contained in:
parent
7426feacf7
commit
30c39e0e41
5 changed files with 15 additions and 3 deletions
|
@ -26,6 +26,7 @@ public:
|
|||
void trim_trailing_whitespace();
|
||||
|
||||
bool is_empty_or_ends_in_whitespace() const;
|
||||
bool ends_with_forced_line_break() const;
|
||||
|
||||
private:
|
||||
friend class BlockContainer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue