-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(url parsing): fix url edge case parsing in images and links
Allow some edge cases to parse correctly. Example: `![img](.images/cat(1).png)`, `![img](<.image(1)/cat(1).png>)`, `[link](<>)`
- Loading branch information
Showing
18 changed files
with
147 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<p>This is a <a href="https://en.wikipedia.org/wiki/Textile">link</a> (some other text)</p> | ||
<p>This is a <a href="https://en.wikipedia.org/wiki/Textile_(markup">link</a> (some other text)</p> | ||
<p>This is a <a href="https://en.wikipedia.org/wiki/Textile_(markup_language)">link</a> (some other text)</p> | ||
<p>This is a <a href="https://en.wikipedia.org/wiki/Textile_(markup_language)/foo">link</a> (some other text)</p> |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
This is a [link](https://en.wikipedia.org/wiki/Textile) (some other text) | ||
|
||
This is a [link](https://en.wikipedia.org/wiki/Textile_(markup) (some other text) | ||
|
||
This is a [link](https://en.wikipedia.org/wiki/Textile_(markup_language)) (some other text) | ||
|
||
This is a [link](https://en.wikipedia.org/wiki/Textile_(markup_language)/foo) (some other text) |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<p><img src="./image/cat1.png" alt="image link" />(some text between brackets)</p> | ||
<p><img src="./image/cat(1).png" alt="image link" />(some text between brackets)</p> |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
![image link](<./image/cat1.png>)(some text between brackets) | ||
|
||
![image link](<./image/cat(1).png>)(some text between brackets) |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<p>This is an <img src="./image/cat(1).png" alt="image" /></p> | ||
<p>This is another <img src="./image/cat(1).png" alt="image" /></p> | ||
<p><a href="http://example.com"><img src="./image/cat(1).png" alt="image link" /></a></p> | ||
<p><a href="http://example.com"><img src="./image/cat1).png" alt="image link" /></a></p> |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
This is an ![image][] | ||
|
||
[image]: ./image/cat(1).png | ||
|
||
This is another ![image](./image/cat(1).png) | ||
|
||
[![image link](./image/cat(1).png)](http://example.com) | ||
|
||
[![image link](<./image/cat1).png>)](http://example.com) |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
<p>This is a <a href="https://en.wikipedia.org/wiki/Textile_(markup_language)" title="Textile">link</a>.</p> | ||
<p>This is another <a href="https://en.wikipedia.org/wiki/Textile_(markup_language)" title="Textile">link</a>.</p> | ||
<p><a href="./image/cat1).png" title="title">link</a></p> |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<p><a href="./images(1)/cat(1).png">link</a></p> | ||
<p><a href="./images(1)/cat(1).png" title="title">link</a></p> | ||
<p><img src="./images(1)/cat(1).png" alt="image" /></p> | ||
<p><img src="./images(1)/cat(1).png" alt="image" title="title" /></p> | ||
<p><img src="./images(1)/cat(1).png" alt="image" title="title" width="800" height="600" /></p> |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[link](<./images(1)/cat(1).png>) | ||
|
||
[link](<./images(1)/cat(1).png> "title") | ||
|
||
![image](<./images(1)/cat(1).png>) | ||
|
||
![image](<./images(1)/cat(1).png> "title") | ||
|
||
![image](<./images(1)/cat(1).png> =800x600 "title") |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<p><img src="images(1)/cat(1).png" alt="my cat" /></p> | ||
<p><a href="images(1)/cat(1).png">my cat</a></p> | ||
<p><img src="some.com/crazy url with spaces" alt="foo" /></p> | ||
<p><img src="some.com/crazy url with spaces" alt="foo" title="title" /></p> | ||
<p><a href="some.com/crazy url with spaces">foo</a></p> | ||
<p><a href="some.com/crazy url with spaces" title="title">foo</a></p> | ||
<p><img src="" alt="empty" /></p> | ||
<p><a href="">empty</a></p> | ||
<p><img src="" alt="empty" title="title" /></p> | ||
<p><a href="" title="title">empty</a></p> | ||
<p><img src="" alt="empty" /></p> | ||
<p><a href="">empty</a></p> | ||
<p><img src="" alt="empty" title="title" /></p> | ||
<p><a href="" title="title">empty</a></p> |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
![my cat](<images(1)/cat(1).png>) | ||
|
||
[my cat](<images(1)/cat(1).png>) | ||
|
||
![foo](<some.com/crazy url with spaces>) | ||
|
||
![foo](<some.com/crazy url with spaces> "title") | ||
|
||
[foo](<some.com/crazy url with spaces>) | ||
|
||
[foo](<some.com/crazy url with spaces> "title") | ||
|
||
![empty](<>) | ||
|
||
[empty](<>) | ||
|
||
![empty](<> "title") | ||
|
||
[empty](<> "title") | ||
|
||
![empty](< >) | ||
|
||
[empty](< >) | ||
|
||
![empty](< > "title") | ||
|
||
[empty](< > "title") |