-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix auto email pattern not recognized
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1442,3 +1442,31 @@ test('Test strikethrough with link with URL that contains tilde', () => { | |
testString = '~[Example Link](https://example.com/?~example=~~~ex~)~'; | ||
expect(parser.replace(testString)).toBe('<del><a href="https://example.com/?~example=~~~ex~" target="_blank" rel="noreferrer noopener">Example Link</a></del>'); | ||
}); | ||
|
||
test('Test autoEmail with markdown of <pre>, <code>, <a>, <mention-user> and <em> tag', () => { | ||
const testString = '`code`[email protected] ' | ||
+ '```code block```[email protected] ' | ||
+ '[Google](https://google.com)[email protected] ' | ||
+ '[email protected]_ ' | ||
+ '_test\n\[email protected]_ ' | ||
+ '`[email protected]` ' | ||
+ '```[email protected]``` ' | ||
+ '@[email protected] ' | ||
+ '_@[email protected]_ ' | ||
+ '[https://staging.new.expensify.com/details/[email protected]](https://staging.new.expensify.com/details/[email protected]) ' | ||
+ '[test italic style wrap email [email protected]_ inside a link](https://google.com) '; | ||
|
||
const resultString = '<code>code</code><a href="mailto:[email protected]">[email protected]</a> ' | ||
+ '<pre>code block</pre><a href="mailto:[email protected]">[email protected]</a> ' | ||
+ '<a href="https://google.com" target="_blank" rel="noreferrer noopener">Google</a><a href="mailto:[email protected]">[email protected]</a> ' | ||
+ '<em><a href="mailto:[email protected]">[email protected]</a></em> ' | ||
+ '<em>test<br /><br /><a href="mailto:[email protected]">[email protected]</a></em> ' | ||
+ '<code>[email protected]</code> ' | ||
+ '<pre>[email protected]</pre> ' | ||
+ '<mention-user>@[email protected]</mention-user> ' | ||
+ '<em><mention-user>@[email protected]</mention-user></em> ' | ||
+ '<a href="https://staging.new.expensify.com/details/[email protected]" target="_blank" rel="noreferrer noopener">https://staging.new.expensify.com/details/[email protected]</a> ' | ||
+ '<a href="https://google.com" target="_blank" rel="noreferrer noopener">test italic style wrap email <em>[email protected]</em> inside a link</a> '; | ||
|
||
expect(parser.replace(testString)).toBe(resultString); | ||
}); |
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