Improve regexps in `HtmlToTextBodyConverter`
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 44
- Forks
- 13
- Avg merge
- 54m
- Merged PRs (30d)
- 1
Description
$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 https://github.com/yiisoft/mailer-view/pull/2#discussion_r1794502710
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the HtmlToTextBodyConverter entry point and review the two PHP regular expressions shown in the issue. Clarify the intended handling of style/script blocks and trailing line spaces before identifying the relevant conversion behavior to verify; the work is done when the expected regex behavior is explicit and validated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100