mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
LibWeb: Simplify Node::text_content()
This commit is contained in:
parent
68189f80cc
commit
2f85af2a20
1 changed files with 1 additions and 5 deletions
|
@ -78,13 +78,9 @@ const HTML::HTMLElement* Node::enclosing_html_element() const
|
|||
|
||||
String Node::text_content() const
|
||||
{
|
||||
Vector<String> strings;
|
||||
StringBuilder builder;
|
||||
for (auto* child = first_child(); child; child = child->next_sibling()) {
|
||||
auto text = child->text_content();
|
||||
if (!text.is_empty()) {
|
||||
builder.append(child->text_content());
|
||||
}
|
||||
builder.append(child->text_content());
|
||||
}
|
||||
return builder.to_string();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue