Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing table cells #3904

Merged
merged 4 commits into from
Feb 5, 2025
Merged

Fix parsing table cells #3904

merged 4 commits into from
Feb 5, 2025

Conversation

plutasnyy
Copy link
Contributor

@plutasnyy plutasnyy commented Feb 5, 2025

This PR:

  • Fixes removing HTML tags that exist in cells
  • stripping function was in general problematic to implement in easy and straightforward way (you can't modify descendants in-place). So I decided instead of patching something in table cell I added stripping everywhere in the same consistent way. This is why some tests needed small edits with removing one white-space in each tag. I believe this won't cause any problems for downstream tasks.

Tested HTML:

<table class="Table">
    <tbody>
        <tr>
            <td colspan="2">
                Some text                                        
            </td>
            <td>
                <input checked="" class="Checkbox" type="checkbox"/>
            </td>
        </tr>
    </tbody>
</table>

Before & After

'<table class="Table" id="..."> <tbody> <tr> <td colspan="2">Some text</td><td></td></tr></tbody></table>'
'<table class="Table" id="..."><tbody><tr><td colspan="2">Some text</td><td><input checked="" type="checkbox"/></td></tr></tbody></table>''

@plutasnyy plutasnyy marked this pull request as ready for review February 5, 2025 13:54
@plutasnyy plutasnyy added this pull request to the merge queue Feb 5, 2025
Merged via the queue into main with commit 5bb95b5 Feb 5, 2025
41 checks passed
@plutasnyy plutasnyy deleted the fix-checkbox-inside-table branch February 5, 2025 16:06
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