@wordpress/autop 3.3.1-next.f435e9e01b.0 → 3.4.0-next.e230fbab09.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/test/index.test.js +10 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/autop",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0-next.e230fbab09.0",
|
|
4
4
|
"description": "WordPress's automatic paragraph functions `autop` and `removep`.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "308df03e6a96ded732f9c4e32471b1b4f8dea54a"
|
|
36
36
|
}
|
package/src/test/index.test.js
CHANGED
|
@@ -66,18 +66,18 @@ test( 'skip pre elements', () => {
|
|
|
66
66
|
done = 0;
|
|
67
67
|
});`;
|
|
68
68
|
|
|
69
|
-
// Not wrapped in <p> tags
|
|
69
|
+
// Not wrapped in <p> tags.
|
|
70
70
|
let str = `<pre>${ code }</pre>`;
|
|
71
71
|
expect( autop( str ).trim() ).toBe( str );
|
|
72
72
|
|
|
73
|
-
// Text before/after is wrapped in <p> tags
|
|
73
|
+
// Text before/after is wrapped in <p> tags.
|
|
74
74
|
str = `Look at this code\n\n<pre>${ code }</pre>\n\nIsn't that cool?`;
|
|
75
75
|
|
|
76
|
-
// Expected text after autop
|
|
76
|
+
// Expected text after autop.
|
|
77
77
|
let expected = `<p>Look at this code</p>\n<pre>${ code }</pre>\n<p>Isn't that cool?</p>`;
|
|
78
78
|
expect( autop( str ).trim() ).toBe( expected );
|
|
79
79
|
|
|
80
|
-
// Make sure HTML breaks are maintained if manually inserted
|
|
80
|
+
// Make sure HTML breaks are maintained if manually inserted.
|
|
81
81
|
str =
|
|
82
82
|
'Look at this code\n\n<pre>Line1<br />Line2<br>Line3<br/>Line4\nActual Line 2\nActual Line 3</pre>\n\nCool, huh?';
|
|
83
83
|
expected =
|
|
@@ -134,7 +134,7 @@ Paragraph two.`;
|
|
|
134
134
|
Paragraph two.`;
|
|
135
135
|
|
|
136
136
|
const expected =
|
|
137
|
-
'<p>Paragraph one.</p>\n' + //
|
|
137
|
+
'<p>Paragraph one.</p>\n' + // Line breaks only after <p>
|
|
138
138
|
'<p><video class="wp-video-shortcode" id="video-0-1" width="640" height="360" preload="metadata" controls="controls">' +
|
|
139
139
|
'<source type="video/mp4" src="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4" />' +
|
|
140
140
|
'<!-- WebM/VP8 for Firefox4, Opera, and Chrome -->' +
|
|
@@ -166,7 +166,7 @@ Paragraph two.`;
|
|
|
166
166
|
Paragraph two.`;
|
|
167
167
|
|
|
168
168
|
const shortcodeExpected =
|
|
169
|
-
'<p>Paragraph one.</p>\n' + //
|
|
169
|
+
'<p>Paragraph one.</p>\n' + // Line breaks only after <p>
|
|
170
170
|
'<p>[video width="720" height="480" mp4="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4"]' +
|
|
171
171
|
'<!-- WebM/VP8 for Firefox4, Opera, and Chrome --><source type="video/webm" src="myvideo.webm" />' +
|
|
172
172
|
'<!-- Ogg/Vorbis for older Firefox and Opera versions --><source type="video/ogg" src="myvideo.ogv" />' +
|
|
@@ -196,7 +196,7 @@ test( 'param embed elements', () => {
|
|
|
196
196
|
Paragraph two.`;
|
|
197
197
|
|
|
198
198
|
const expected1 =
|
|
199
|
-
'<p>Paragraph one.</p>\n' + //
|
|
199
|
+
'<p>Paragraph one.</p>\n' + // Line breaks only after <p>
|
|
200
200
|
'<p><object width="400" height="224" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">' +
|
|
201
201
|
'<param name="src" value="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" />' +
|
|
202
202
|
'<param name="allowfullscreen" value="true" />' +
|
|
@@ -232,7 +232,7 @@ Paragraph two.`;
|
|
|
232
232
|
Paragraph two.`;
|
|
233
233
|
|
|
234
234
|
const expected2 =
|
|
235
|
-
'<p>Paragraph one.</p>\n' + //
|
|
235
|
+
'<p>Paragraph one.</p>\n' + // Line breaks only after block tags.
|
|
236
236
|
'<div class="video-player" id="x-video-0">\n' +
|
|
237
237
|
'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="640" height="360" id="video-0" standby="Standby text">' +
|
|
238
238
|
'<param name="movie" value="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" />' +
|
|
@@ -318,11 +318,11 @@ test( 'that_autop_treats_block_level_elements_as_blocks', () => {
|
|
|
318
318
|
} );
|
|
319
319
|
|
|
320
320
|
let expected = content.join( '\n' );
|
|
321
|
-
let input = content.join( '\n\n' ); // WS difference
|
|
321
|
+
let input = content.join( '\n\n' ); // WS difference.
|
|
322
322
|
|
|
323
323
|
expect( autop( input ).trim() ).toBe( expected );
|
|
324
324
|
|
|
325
|
-
input = content.join( '' ); // WS difference
|
|
325
|
+
input = content.join( '' ); // WS difference.
|
|
326
326
|
|
|
327
327
|
expect( autop( input ).trim() ).toBe( expected );
|
|
328
328
|
|