fix(table): handle HTML table captions correctly
Closes #635
This PR fixes incorrect handling of HTML
Screenshots or Video
Input (HTML with
<table>
<caption>Employee Details</caption>
<thead>
<tr>
<th>Name</th>
<th>Role</th>
</tr>
</thead>
<tbody>
<tr>
<td>Alice</td>
<td>Engineer</td>
</tr>
<tr>
<td>Bob</td>
<td>Designer</td>
</tr>
</tbody>
</table>
the output:
**Employee Details**
| Name | Role |
|---------|---------|
| Alice | Engineer |
| Bob | Designer |
Related Issues
- Issue #635
Author Checklist
- [x] Ensure you provide a DCO sign-off for your commits using the
--signoffoption of git commit. - [x] Vital features and changes captured in unit and/or integration tests
- [x] Commits messages follow AP format
- [ ] Extend the documentation, if necessary
- [x] Merging to
mainfromfork:branchname
hi @mttrbrts can review PR
Thanks @omda777 for working on this caption handling fix! The approach looks good, but I noticed some issues to address:
Tests Required The PR modifies significant deserialization logic but doesn't include any test coverage. Per repo guidelines, bug fixes must include regression tests. Please add tests for:
<caption>element deserializationcleanTableNodes()whitespace normalization- Edge case:
<tbody>with<th>cells and no<thead> - Tables without captions (ensure no regression)
Minor: Code Style
The cleanTableNodes function has inconsistent brace placement. Please use the repo's standard style (braces on same line as if/else).
Once tests are added, this should be good to merge. Thanks for contributing! 🙏
This comment was generated by AI on behalf of @mttrbrts.