-
-
Notifications
You must be signed in to change notification settings - Fork 198
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 #899 from thephpleague/fix-embed-parsing
Fix embed parsing
- Loading branch information
Showing
9 changed files
with
116 additions
and
6 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
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
7 changes: 7 additions & 0 deletions
7
tests/functional/Extension/Embed/data/after_list_regression.html
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 @@ | ||
<h1>Embed Bug</h1> | ||
<ul> | ||
<li>Both links below</li> | ||
<li>Should be embeds</li> | ||
</ul> | ||
<iframe class="embed" src="https://www.youtube.com/watch?v=dQw4w9WgXcQ"></iframe> | ||
<iframe class="embed" src="https://www.youtube.com/watch?v=dQw4w9WgXcQ"></iframe> |
8 changes: 8 additions & 0 deletions
8
tests/functional/Extension/Embed/data/after_list_regression.md
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,8 @@ | ||
# Embed Bug | ||
|
||
- Both links below | ||
- Should be embeds | ||
|
||
https://www.youtube.com/watch?v=dQw4w9WgXcQ | ||
|
||
https://www.youtube.com/watch?v=dQw4w9WgXcQ |
27 changes: 27 additions & 0 deletions
27
tests/functional/Extension/Embed/data/embeds-with-autolinks-enabled.html
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 @@ | ||
<p>This is an embed:</p> | ||
<iframe class="embed" src="https://www.youtube.com/watch?v=dQw4w9WgXcQ"></iframe> | ||
<p>So is this, with only three spaces of indentation:</p> | ||
<iframe class="embed" src="https://www.youtube.com/watch?v=dQw4w9WgXcQ"></iframe> | ||
<p>This is not, because it's fully indented:</p> | ||
<pre><code>https://www.youtube.com/watch?v=dQw4w9WgXcQ | ||
</code></pre> | ||
<p>This is not, because it has extra bits after the URL:</p> | ||
<p><a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ">https://www.youtube.com/watch?v=dQw4w9WgXcQ</a> <-- you gotta watch this!</p> | ||
<p>This is not, because it's in a fenced code block:</p> | ||
<pre><code class="language-md"> | ||
https://www.youtube.com/watch?v=dQw4w9WgXcQ | ||
|
||
</code></pre> | ||
<p>And this isn't either because it's inline: <img src="https://www.youtube.com/watch?v=dQw4w9WgXcQ" alt="" /></p> | ||
<p>Embeds can't be nested in other blocks:</p> | ||
<ul> | ||
<li>https://www.youtube.com/watch?v=dQw4w9WgXcQ | ||
<ul> | ||
<li>https://www.youtube.com/watch?v=dQw4w9WgXcQ</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
<p>This isn't valid because it's a lazy paragraph continuation: | ||
<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ">https://www.youtube.com/watch?v=dQw4w9WgXcQ</a></p> | ||
<iframe class="embed" src="https://www.youtube.com/watch?v=dQw4w9WgXcQ"></iframe> | ||
<p>^ This is fine, though</p> |
40 changes: 40 additions & 0 deletions
40
tests/functional/Extension/Embed/data/embeds-with-autolinks-enabled.md
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,40 @@ | ||
--- | ||
enable_autolinks: true | ||
--- | ||
|
||
This is an embed: | ||
|
||
https://www.youtube.com/watch?v=dQw4w9WgXcQ | ||
|
||
So is this, with only three spaces of indentation: | ||
|
||
https://www.youtube.com/watch?v=dQw4w9WgXcQ | ||
|
||
This is not, because it's fully indented: | ||
|
||
https://www.youtube.com/watch?v=dQw4w9WgXcQ | ||
|
||
This is not, because it has extra bits after the URL: | ||
|
||
https://www.youtube.com/watch?v=dQw4w9WgXcQ <-- you gotta watch this! | ||
|
||
This is not, because it's in a fenced code block: | ||
|
||
```md | ||
|
||
https://www.youtube.com/watch?v=dQw4w9WgXcQ | ||
|
||
``` | ||
|
||
And this isn't either because it's inline: ![](https://www.youtube.com/watch?v=dQw4w9WgXcQ) | ||
|
||
Embeds can't be nested in other blocks: | ||
|
||
- https://www.youtube.com/watch?v=dQw4w9WgXcQ | ||
- https://www.youtube.com/watch?v=dQw4w9WgXcQ | ||
|
||
This isn't valid because it's a lazy paragraph continuation: | ||
https://www.youtube.com/watch?v=dQw4w9WgXcQ | ||
|
||
https://www.youtube.com/watch?v=dQw4w9WgXcQ | ||
^ This is fine, though |