mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:27:43 +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.
|
// FIXME: Escape the value string as necessary.
|
||||||
TRY(builder.try_appendff(" {}='{}'", key, value));
|
TRY(builder.try_appendff(" {}='{}'", key, value));
|
||||||
}
|
}
|
||||||
TRY(builder.try_append(" style=\""sv));
|
if (!style.is_empty()) {
|
||||||
for (auto const& [key, value] : style) {
|
TRY(builder.try_append(" style=\""sv));
|
||||||
// FIXME: Escape the value string as necessary.
|
for (auto const& [key, value] : style) {
|
||||||
TRY(builder.try_appendff(" {}: {};", key, value));
|
// 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())
|
if (!inner_text.is_empty())
|
||||||
TRY(builder.try_append(inner_text));
|
TRY(builder.try_append(inner_text));
|
||||||
for (auto const& child : children) {
|
for (auto const& child : children) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue