Skip to content

Improve regexps in HtmlToTextBodyConverter #110

Description

@vjik
$html = preg_replace('~<(style|script)[^>]*>.*?</\1>~is', '', $html);
// ...

// Does it make sense to remove spaces from the end of lines?
$text = preg_replace("~^[ \t]+|[ \t]+$~m", '', trim($text));

Originally posted by @Tigrov in yiisoft/mailer-view#2 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions