feat: convert content type in html meta tags

This commit is contained in:
James Houlahan
2020-09-04 12:52:07 +02:00
parent afeed4a801
commit 9b3cc9dc34
5 changed files with 69 additions and 21 deletions

View File

@ -93,6 +93,13 @@ func convertForeignEncodings(p *parser.Parser) error {
// HELP: Is it correct to only do this to text types?
return p.NewWalker().
RegisterContentTypeHandler("text/html", func(p *parser.Part) error {
if err := p.ConvertToUTF8(); err != nil {
return err
}
return p.ConvertMetaCharset()
}).
RegisterContentTypeHandler("text/.*", func(p *parser.Part) error {
return p.ConvertToUTF8()
}).