OWASP / java-html-sanitizer

Takes third-party HTML and produces HTML that is safe to embed in your web application. Fast and easy to configure.
Other
850 stars 214 forks source link

Issue for tr td th tbody #252

Open jimmyleeeeee opened 2 years ago

jimmyleeeeee commented 2 years ago

The input is like below:

```html
<tr><td>data</td></tr>"  or "<td>data</td>
 , for th and tbody, the case is similiar. The common point is that there is no table tag. 
The output is always append table and tbody, it looks like below:

````md
```html
<table><tbody><tr><td>data</td></tr></tbody></table>

Is it possible to just check whether the tag is legal and don't append other tag?

For example, if the input is 
````md
```html
<td>data</td>
, the expected output is 
````md
```html
<td>data</td>

 but not append table and tbody tag.