feat: add option for table chunking (#4354)
## Summary
Adds `isolate_tables` (default `True`) to `chunk_elements` and
`chunk_by_title`, making the PR #4307 table-isolation behavior optional.
- `True` (default): preserves current behavior — `Table`/`TableChunk`
elements are always staged alone and never combined with neighbors by
`PreChunkCombiner`.
- `False`: restores the pre-#4307 behavior — tables can share pre-chunks
with adjacent text and be combined into a `CompositeElement`.
Rejects `skip_table_chunking=True` + `isolate_tables=False` with a
`ValueError`, since the pass-through path only fires when a table is
alone in its pre-chunk.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds `isolate_tables` to `chunk_elements` and `chunk_by_title` to toggle
table isolation; default `True` preserves current behavior, while
`False` lets tables share pre-chunks and merge with adjacent text into
`CompositeElement`s. Validation now uses bool-coerced options and raises
`ValueError` when `skip_table_chunking=True` with `isolate_tables=False`
(including falsy values like `0`) for predictable behavior.
<sup>Written for commit 1da0506ebee07437b97ef6abc5da7592dc82fdd3.
Summary will update on new commits. <a
href="https://cubic.dev/pr/Unstructured-IO/unstructured/pull/4354?utm_source=github">Review
in cubic</a></sup>
<!-- End of auto-generated description by cubic. -->
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>