OWASP/java-html-sanitizer

Issues encountered while processing <a> tags

hw30026125 opened this issue · 0 comments

When I have the following table and hyperlink in my html code

```html
<table>
    <tr>
        <td>
            <a href="http://www.bing.com">
                <table>
                    <tbody>
                    <tr>
                        <td>
                            <a href="http://www.bing.com">11111</a>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <a href="http://www.bing.com">22222</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </a>
        </td>
    </tr>
</table>
```

After the owasp processing, the code becomes like this:

```
    <table>
        <tbody>
            <tr>
                <td>
                    <a href="http://www.bing.com">
                        <table>
                            <tbody>
                                <tr>
                                    <td> </td>
                                </tr>
                            </tbody>
                        </table>
                    </a>
                    <a href="http://www.bing.com">11111</a>
                </td>
            </tr>
            <tr>
                <td>
                    <a href="http://www.bing.com">22222</a>
                </td>
            </tr>
        </tbody>
    </table>
```

The original layout of the table has changed. Is this a bug?