-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from networkteam/fix-matching-newline-charcter
fix: matching newline chars inside link tag
- Loading branch information
Showing
3 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,7 +77,7 @@ public function emailsAreConverted($rawText, $expectedText) | |
->will($this->returnValueMap([ | ||
['value', $rawText], | ||
['patternMailTo', '/(href=")mailto:([^"]*)/'], | ||
['patternMailDisplay', '|(href="mailto:[^>]*>)(.*?)(<\/a>)|'] | ||
['patternMailDisplay', '/(href="mailto:[^>]*>)((.|\n)*?)(<\/a>)/'] | ||
])); | ||
|
||
$actualResult = $this->convertEmailLinks->evaluate(); | ||
|
@@ -122,6 +122,14 @@ static public function emailTexts(): array | |
'email address in link tag enclosed by multiple styling tags' => [ | ||
'Email <a href="mailto: [email protected]" itemprop="email"><i class="fa-light fa-paper-plane"></i><span class="btn__text">[email protected]</span></a>', | ||
'Email <a href="' . $htmlEncodedDecryptionString . '" itemprop="email"><i class="fa-light fa-paper-plane"></i><span class="btn__text">test (at) example.com</span></a>' | ||
], | ||
'email address in link tag enclosed by multiple styling tags and new line characters' => [ | ||
'Email <a href="mailto: [email protected]" itemprop="email"> | ||
<i class="fa-light fa-paper-plane"></i> | ||
<span class="btn__text">[email protected]</span> | ||
</a>', | ||
'Email <a href="' . $htmlEncodedDecryptionString . '" itemprop="email"><i class="fa-light fa-paper-plane"></i> | ||
<span class="btn__text">test (at) example.com</span></a>' | ||
] | ||
]; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters