Skip to content

fix: preserve table cells whose children are empty (fixes #94) - #95

Open
domenicopolicastro wants to merge 1 commit into
crosstype:masterfrom
domenicopolicastro:fix/empty-cells-with-empty-children
Open

domenicopolicastro wants to merge 1 commit into
crosstype:masterfrom
domenicopolicastro:fix/empty-cells-with-empty-children

Conversation

@domenicopolicastro

Copy link
Copy Markdown
  • src/visitor.ts: if none of an element's children have content, the element is still preserved when its translator sets preserveIfEmpty. This matches the option's documented meaning ("always visited, even if element is empty"). Translator factory functions keep their current behaviour. The translator is only looked up in this case, so the common path does no extra work.
  • test/table.test.ts: new Empty Cells with empty children test (empty <p> / <span> / nested / multiple empty <p> cells, empty header cell, row of only empty cells), next to the existing Empty Cells test.

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