Fixes #6295 - Prevents duplicate tags
Merge pull request #6296 from juho-jaakkola/issue-6295

Fixes #6295 - Prevents Htmlawed from malforming tags