mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibHTML: Make "white-space: pre" kinda work
This is not ideal, as refusing to break lines will easily overflow the containing block, and we have no way of dealing with overflow yet. But as long as you provide enough width, it does look nice. :^)
This commit is contained in:
parent
b0d2117bfd
commit
f908a2718a
Notes:
sideshowbarker
2024-07-19 11:49:48 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f908a2718a7
@ -157,10 +157,14 @@ void LayoutText::for_each_source_line(Callback callback) const
|
||||
};
|
||||
|
||||
for (auto it = view.begin(); it != view.end();) {
|
||||
if (*it == '\n')
|
||||
bool did_commit = false;
|
||||
if (*it == '\n') {
|
||||
commit_line(it);
|
||||
did_commit = true;
|
||||
}
|
||||
++it;
|
||||
start_of_line = it;
|
||||
if (did_commit)
|
||||
start_of_line = it;
|
||||
}
|
||||
if (start_of_line != view.end())
|
||||
commit_line(view.end());
|
||||
|
Loading…
Reference in New Issue
Block a user