Skip to content

refactor: consolidate 0-slots handling to rely on markdown#84

Merged
melissag-ensemble merged 1 commit intomainfrom
no-slots
Mar 11, 2026
Merged

refactor: consolidate 0-slots handling to rely on markdown#84
melissag-ensemble merged 1 commit intomainfrom
no-slots

Conversation

@melissag-ensemble
Copy link
Copy Markdown
Collaborator

@melissag-ensemble melissag-ensemble commented Mar 11, 2026

Description

Reduce the three ways we end up with 0 slots to a single approach.

Previous approaches:

  • HorizontalLine - slots was forced to [], so totalSlots = repeat * 0 = 0
  • Fragment / iframe - repeat was forced to 0, so totalSlots = 0 * slots.length = 0
  • Missing/empty slots - When slots is missing or empty, parsing yields [], so totalSlots = repeat * 0 = 0

All three produced 0 nodes consumed as slot content, but via different logic. This PR consolidates on # 3 to treat the markdown document as the source of truth - if a block has no slots attribute (or it's empty), treat it as 0 slots.

Test

Screenshot 2026-03-11 at 9 39 50 AM Screenshot 2026-03-11 at 9 34 39 AM fragment Screenshot 2026-03-11 at 8 07 19 AM Screenshot 2026-03-11 at 8 12 15 AM Screenshot 2026-03-11 at 8 10 23 AM

@melissag-ensemble melissag-ensemble merged commit 08f0072 into main Mar 11, 2026
1 check failed
@melissag-ensemble melissag-ensemble deleted the no-slots branch March 11, 2026 16:52
@louisachu louisachu restored the no-slots branch March 16, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants