-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
One of our emails has a multi-line HTML comment in it and I noticed it messes with EmailReplyParser.
Example PHP code:
<?php
$parser = new EmailReplyParser\Parser\EmailParser();
$emailContent = "Start of test message,
<!--
a multi-line HTML comment
-->
End of of test message.";
echo $parser->parse($emailContent)->getVisibleText();Outputs:
Start of test message,
<!--
a multi-line HTML comment%
The workaround is to remove the comments before giving the content to EmailReplyParser.
// Remove HTML comments from email content (because the EmailReplyParser doesn't like them)
$emailContent = preg_replace('/<!--(.|\s)*?-->/', '', $text);
echo $parser->parse($emailContent)->getVisibleText();Using EmailReplyParser v2.10.0 with PHP 7.4.
maxlipsky-ca and MitchTalmadge
Metadata
Metadata
Assignees
Labels
No labels