tags such as meta and link are marked in the default tag provider as belongs to head.
this is incorrect. these tags can be used as part of the schema.org item descriptions.
for anyone with this issue you can solve it by changing the default tagprovider instance.
private val htmlcleanerTagProvider = {
DefaultTagProvider.INSTANCE.getTagInfo("meta").setBelongsTo(BelongsTo.HEAD_AND_BODY);
DefaultTagProvider.INSTANCE.getTagInfo("link").setBelongsTo(BelongsTo.HEAD_AND_BODY);
DefaultTagProvider.INSTANCE
}
and then feeding it to the cleanr constructor HTMLCLeaner(htmlcleanerTagProvider)
Thanks Haadar,
Yes as of HTML5, meta is allowed inside body. Likewise link where it has an itemprop attribute.
We can change the Html5TagProvider to make this the default.
S
Tagging to address in 2.14
This has now been set to the default behaviour for HTML5 in HC