我正在使用 nekohtml 解析器来解析我的 html 代码。有时我在使用锚标签时犯了错误,内容是这样写的。
<a href="http://abc.com"><a href="http://abc.com">abc</a></a>
通过 nekohtml 解析后,我希望内容像这样更正。
<a href="http://abc.com"></a><a href="http://abc.com">abc</a>
为此,请帮助配置 nekohtml 解析。
更新:
在我尝试设置为
parser.setFeature("http://cyberneko.org/html/features/balance-tags", true);
它没有用。我没有像我预期的那样给出结果。它返回与我给出的相同的 html 内容