Skip to content

fix: stop empty output from containers wrongly treated as hidden - #97

Merged
hownowstephen merged 2 commits into
mainfrom
fix_hidden_container_empty_output
Sep 26, 2026
Merged

hownowstephen merged 2 commits into
mainfrom
fix_hidden_container_empty_output

Conversation

@hownowstephen

@hownowstephen hownowstephen commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Some email layouts converted to an empty string, which SendGrid rejects with a 400. The hidden-content check dropped entire subtrees for styles that don't actually hide them:

  • font-size:0 is inherited and reset by descendants (the inline-block gap fix that often wraps a whole layout), so it's no longer treated as hidden.
  • max-height:0 only hides with overflow:hidden, so it now requires both.

Hiding is still a guess from inline styles, so this adds WithHiddenContent() to keep hidden content. Callers that need text can retry with it when Convert returns empty; the library doesn't retry on its own.

…and fall back to hidden content rather than return empty output
@hownowstephen
hownowstephen marked this pull request as ready for review September 26, 2026 17:04
@hownowstephen
hownowstephen merged commit 6601a83 into main Sep 26, 2026
5 checks passed
@hownowstephen
hownowstephen deleted the fix_hidden_container_empty_output branch September 26, 2026 17:09
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.

1 participant