mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:27:35 +00:00
Presenter: Don't give a style value if there are no styles
This commit is contained in:
parent
fcda397136
commit
244ea0fa9c
1 changed files with 8 additions and 5 deletions
|
@ -145,12 +145,15 @@ ErrorOr<void> HTMLElement::serialize(StringBuilder& builder) const
|
|||
// FIXME: Escape the value string as necessary.
|
||||
TRY(builder.try_appendff(" {}='{}'", key, value));
|
||||
}
|
||||
TRY(builder.try_append(" style=\""sv));
|
||||
for (auto const& [key, value] : style) {
|
||||
// FIXME: Escape the value string as necessary.
|
||||
TRY(builder.try_appendff(" {}: {};", key, value));
|
||||
if (!style.is_empty()) {
|
||||
TRY(builder.try_append(" style=\""sv));
|
||||
for (auto const& [key, value] : style) {
|
||||
// FIXME: Escape the value string as necessary.
|
||||
TRY(builder.try_appendff(" {}: {};", key, value));
|
||||
}
|
||||
TRY(builder.try_append("\""sv));
|
||||
}
|
||||
TRY(builder.try_append("\">"sv));
|
||||
TRY(builder.try_append(">"sv));
|
||||
if (!inner_text.is_empty())
|
||||
TRY(builder.try_append(inner_text));
|
||||
for (auto const& child : children) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue