1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00

AK: Replace String::trim_spaces() with String::trim_whitespace()

As suggested by @awesomekling in a code review and (initially) ignored
by me :^)

Implementation is roughly based on LibJS's trim_string(), but with a fix
for trimming all-whitespace strings.
This commit is contained in:
Linus Groh 2020-05-13 00:20:52 +01:00 committed by Andreas Kling
parent 0c14ee035c
commit 1febee768d
3 changed files with 41 additions and 12 deletions

View file

@ -144,7 +144,7 @@ void StyleProperties::load_font() const
// FIXME: Do this properly, with quote handling etc.
for (auto& font_name : font_family.split(',')) {
font_name = font_name.trim_spaces();
font_name = font_name.trim_whitespace();
if (font_name == "monospace")
font_name = "Csilla";