-
-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix false positive flagging of standalone autolinks as self-closing html
fixes #208
- Loading branch information
Showing
3 changed files
with
62 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3126,6 +3126,42 @@ exports[`markdown-to-jsx compiler links should handle autolink style 1`] = ` | |
`; | ||
exports[`markdown-to-jsx compiler links should handle autolinks after a paragraph (regression) 1`] = ` | ||
<div data-reactroot> | ||
<p> | ||
<strong> | ||
autolink | ||
</strong> | ||
style | ||
</p> | ||
<p> | ||
<a href="https://google.com"> | ||
https://google.com | ||
</a> | ||
</p> | ||
</div> | ||
`; | ||
exports[`markdown-to-jsx compiler links should handle mailto autolinks after a paragraph 1`] = ` | ||
<div data-reactroot> | ||
<p> | ||
<strong> | ||
autolink | ||
</strong> | ||
style | ||
</p> | ||
<p> | ||
<a href="mailto:[email protected]"> | ||
[email protected] | ||
</a> | ||
</p> | ||
</div> | ||
`; | ||
exports[`markdown-to-jsx compiler links should sanitize links containing JS expressions 1`] = ` | ||
<a data-reactroot> | ||
|
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 |
---|---|---|
|
@@ -322,6 +322,30 @@ describe('markdown-to-jsx', () => { | |
expect(root.innerHTML).toMatchSnapshot(); | ||
}); | ||
|
||
it('should handle autolinks after a paragraph (regression)', () => { | ||
render( | ||
compiler(` | ||
**autolink** style | ||
<https://google.com> | ||
`) | ||
); | ||
|
||
expect(root.innerHTML).toMatchSnapshot(); | ||
}); | ||
|
||
it('should handle mailto autolinks after a paragraph', () => { | ||
render( | ||
compiler(` | ||
**autolink** style | ||
<mailto:[email protected]> | ||
`) | ||
); | ||
|
||
expect(root.innerHTML).toMatchSnapshot(); | ||
}); | ||
|
||
it('should handle a mailto autolink', () => { | ||
render(compiler('<mailto:[email protected]>')); | ||
|
||
|