Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add failing test case #24

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/cases/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ const html = [
data: minify(read('./complex.html'), {
collapseWhitespace: true
})
},
{
name: 'html with script',
data: minify(read('./with-script.html'), {
collapseWhitespace: true
})
rburgst marked this conversation as resolved.
Show resolved Hide resolved
}
];

Expand Down
214 changes: 214 additions & 0 deletions test/cases/with-script.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
<div>
<p>lorem</p>
<p>&nbsp;</p>
<p><strong>wp playlist</strong></p>
<!--[if lt IE 9]>
<script>
document.createElement('audio');
</script><!
[endif]-->
<div class="wp-playlist wp-audio-playlist wp-playlist-light">
<div class="wp-playlist-current-item" />
<audio
controls="controls"
preload="none"
width="640"
/>
<div class="wp-playlist-next" />
<div class="wp-playlist-prev" />
<noscript>
<ol>
<li>
<a
href="https://server.com/wp-content/uploads/2019/04/part1.mp3"
>part 1</a
>
</li>
<li>
<a
href="https://server.com/wp-content/uploads/2019/04/part2.mp3"
>part 2</a
>
</li>
<li>
<a
href="https://server.com/wp-content/uploads/2019/04/part3.mp3"
>part 3</a
>
</li>
<li>
<a
href="https://server.com/wp-content/uploads/2019/04/part4.mp3"
>part 4</a
>
</li>
<li>
<a
href="https://server.com/wp-content/uploads/2019/04/part5.mp3"
>part 5</a
>
</li>
<li>
<a
href="https://server.com/wp-content/uploads/2019/04/part6.mp3"
>part 6</a
>
</li>
</ol>
</noscript>
<script type="application/json" class="wp-playlist-script">
{
"type": "audio",
"tracklist": true,
"tracknumbers": true,
"images": false,
"artists": false,
"tracks": [
{
"src": "http:\/\/dockerhost:8000\/wp-content\/uploads\/2019\/04\/part1.mp3",
"type": "audio\/mpeg",
"title": "part 1",
"caption": "",
"description": "\"Part 1\".",
"meta": {
"length_formatted": "6:57"
},
"image": {
"src": "http:\/\/dockerhost:8000\/wp-includes\/images\/media\/audio.png",
"width": 48,
"height": 64
},
"thumb": {
"src": "http:\/\/dockerhost:8000\/wp-includes\/images\/media\/audio.png",
"width": 48,
"height": 64
}
},
{
"src": "http:\/\/dockerhost:8000\/wp-content\/uploads\/2019\/04\/part2.mp3",
"type": "audio\/mpeg",
"title": "part 2",
"caption": "",
"description": "\"part 2\".",
"meta": {
"length_formatted": "5:11"
},
"image": {
"src": "http:\/\/dockerhost:8000\/wp-includes\/images\/media\/audio.png",
"width": 48,
"height": 64
},
"thumb": {
"src": "http:\/\/dockerhost:8000\/wp-includes\/images\/media\/audio.png",
"width": 48,
"height": 64
}
},
{
"src": "http:\/\/dockerhost:8000\/wp-content\/uploads\/2019\/04\/part3.mp3",
"type": "audio\/mpeg",
"title": "part 3",
"caption": "",
"description": "\"part 3\".",
"meta": {
"length_formatted": "6:32"
},
"image": {
"src": "http:\/\/dockerhost:8000\/wp-includes\/images\/media\/audio.png",
"width": 48,
"height": 64
},
"thumb": {
"src": "http:\/\/dockerhost:8000\/wp-includes\/images\/media\/audio.png",
"width": 48,
"height": 64
}
},
{
"src": "http:\/\/dockerhost:8000\/wp-content\/uploads\/2019\/04\/part4.mp3",
"type": "audio\/mpeg",
"title": "part 4",
"caption": "",
"description": "\"part 4\".",
"meta": {
"length_formatted": "7:43"
},
"image": {
"src": "http:\/\/dockerhost:8000\/wp-includes\/images\/media\/audio.png",
"width": 48,
"height": 64
},
"thumb": {
"src": "http:\/\/dockerhost:8000\/wp-includes\/images\/media\/audio.png",
"width": 48,
"height": 64
}
},
{
"src": "http:\/\/dockerhost:8000\/wp-content\/uploads\/2019\/04\/part5.mp3",
"type": "audio\/mpeg",
"title": "part 5",
"caption": "",
"description": "\"part 5\".",
"meta": {
"length_formatted": "5:49"
},
"image": {
"src": "http:\/\/dockerhost:8000\/wp-includes\/images\/media\/audio.png",
"width": 48,
"height": 64
},
"thumb": {
"src": "http:\/\/dockerhost:8000\/wp-includes\/images\/media\/audio.png",
"width": 48,
"height": 64
}
},
{
"src": "http:\/\/dockerhost:8000\/wp-content\/uploads\/2019\/04\/part6.mp3",
"type": "audio\/mpeg",
"title": "part 6",
"caption": "",
"description": "\"part 6\".",
"meta": {
"length_formatted": "0:38"
},
"image": {
"src": "http:\/\/dockerhost:8000\/wp-includes\/images\/media\/audio.png",
"width": 48,
"height": 64
},
"thumb": {
"src": "http:\/\/dockerhost:8000\/wp-includes\/images\/media\/audio.png",
"width": 48,
"height": 64
}
}
]
}
</script>
</div>

<p><strong>html5 audio</strong></p>
<!--[if lt IE 9]>
<script>
document.createElement('audio');
</script><!
[endif]-->
<audio
class="wp-audio-shortcode"
id="audio-2538-1"
preload="none"
style="width: 100%;"
controls="controls"
>
<source
type="audio/mpeg"
src="https://server.com/wp-content/uploads/2019/04/part1.mp3"
/>
<a
href="https://server.com/wp-content/uploads/2019/04/part1.mp3"
>http://dockerhost:8000/wp-content/uploads/2019/04/part1.mp3</a
>
</audio>
</div>