ezyang / ezyang/htmlpurifier

<thead> element removed from <table> if there are no <tbody> or <tr> elements

Open
#264 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.4k
Forks
361
Avg merge
3d 41m
Merged PRs (30d)
2

Description

Using the default config, the <thead> element from a <table> will be removed, if there are no other <tbody> or <tr> elements in the <table>.
According to the HTML Living Standard and the W3C Recommendation it is valid to have a <table> element with only a <thead> child.

Here are two Live Demos demonstrating the bug:
Bug
Expected Output

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided Bug and Expected Output live demos, then trace the table-element handling in HTMLPurifier. Compare the behavior with the linked HTML standards; done means a table containing only a thead is preserved under the default configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.