Skip to content

Commit

Permalink
vaev-style: Fix background-color parser being too greedy.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Nov 26, 2024
1 parent 4281732 commit 68b3ee3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 9 additions & 1 deletion samples/boostrap.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</head>

<body>
<nav class="navbar navbar-expand-xl">
<nav class="navbar navbar-expand-xl navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarDark"
Expand All @@ -36,6 +36,14 @@
</div>
</nav>

<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="#">Library</a></li>
<li class="breadcrumb-item active" aria-current="page">Data</li>
</ol>
</nav>

<div class="card">
<div class="card-header">
Buttons
Expand Down
10 changes: 7 additions & 3 deletions src/vaev-style/styles.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,16 @@ struct BackgroundColorProp {
}

Res<> parse(Cursor<Css::Sst> &c) {
eatWhitespace(c);
value.clear();
while (not c.ended()) {
value.pushBack(try$(parseValue<Color>(c)));

eatWhitespace(c);
auto maybeColor = parseValue<Color>(c);
while (maybeColor) {
value.pushBack(maybeColor.take());
eatWhitespace(c);
maybeColor = parseValue<Color>(c);
}

return Ok();
}
};
Expand Down

0 comments on commit 68b3ee3

Please sign in to comment.