Skip to content

Commit

Permalink
Fix specification multiple values
Browse files Browse the repository at this point in the history
  • Loading branch information
TomaszDziezykNetcentric committed Oct 31, 2024
1 parent d7d3223 commit c0a9fd1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions blocks/specification/specification.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ export default function decorate(block) {
textContent.querySelectorAll('.specification-label').forEach((el) => {
const stat = document.createElement('div');
stat.classList.add('specification-stat');
const valueEl = el.nextElementSibling;
let valueEl = el.nextElementSibling;

while (valueEl && valueEl.classList.contains('specification-value')) {
const siblingEl = valueEl.nextElementSibling;
stat.append(valueEl);
valueEl = siblingEl;
}

stat.prepend(el);

stat.append(el);
stat.append(valueEl);
specificationStatsWrapper.append(stat);
});

Expand Down

0 comments on commit c0a9fd1

Please sign in to comment.