when detecting html, allow for xhtml #303
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
some html emails have additional attrs (like an xml namespace) in the
<html>
tag, so that"<html>" in body_content
is false, e.g.<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head>
msg_parser failed in parsing this email, outputting an .eml file marked as content-type
text/plain
but containing HTML tags.This one-byte proposed change causes msg_parser to behave correctly, outputting an HTML-based .eml file that's parsed appropriately by other libraries.
Unfortunately, I cannot include the file that caused this error; it's confidential. I was unable to find or generate a non-confidential file that exhibits the same properties. If you have any tips on how to do so using only Mac Outlook (or maybe Outlook Web Access), I'd be happy to do so.