Skip to content

Commit

Permalink
Fix padding
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Feb 12, 2019
1 parent f7573a5 commit 690eb1c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,10 +525,10 @@ function gutenberg_preload_api_request( $memo, $path ) {
* @since 0.1.0
*/
function gutenberg_register_vendor_scripts() {
$suffix = SCRIPT_DEBUG ? '' : '.min';
$suffix = true ? '' : '.min';

// Vendor Scripts.
$react_suffix = ( SCRIPT_DEBUG ? '.development' : '.production' ) . $suffix;
$react_suffix = ( true ? '.development' : '.production' ) . $suffix;

gutenberg_register_vendor_script(
'react',
Expand All @@ -540,7 +540,7 @@ function gutenberg_register_vendor_scripts() {
'https://unpkg.com/react-dom@16.6.3/umd/react-dom' . $react_suffix . '.js',
array( 'react' )
);
$moment_script = SCRIPT_DEBUG ? 'moment.js' : 'min/moment.min.js';
$moment_script = true ? 'moment.js' : 'min/moment.min.js';
gutenberg_register_vendor_script(
'moment',
'https://unpkg.com/moment@2.22.1/' . $moment_script,
Expand Down
15 changes: 15 additions & 0 deletions packages/rich-text/src/test/__snapshots__/to-dom.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,18 @@ exports[`recordToDom should create a value without formatting 1`] = `
exports[`recordToDom should create an empty value 1`] = `
<React.Fragment>
<br
data-rich-text-padding="true"
/>
</React.Fragment>
`;

exports[`recordToDom should create an empty value from empty tags 1`] = `
<React.Fragment>
<br
data-rich-text-padding="true"
/>
</React.Fragment>
`;

Expand Down Expand Up @@ -214,6 +220,9 @@ exports[`recordToDom should handle empty list value 1`] = `
<React.Fragment>
<li>
<br
data-rich-text-padding="true"
/>
</li>
</React.Fragment>
`;
Expand All @@ -222,6 +231,9 @@ exports[`recordToDom should handle empty multiline value 1`] = `
<React.Fragment>
<p>
<br
data-rich-text-padding="true"
/>
</p>
</React.Fragment>
`;
Expand Down Expand Up @@ -431,6 +443,9 @@ exports[`recordToDom should preserve non breaking space 1`] = `
exports[`recordToDom should remove padding 1`] = `
<React.Fragment>
<br
data-rich-text-padding="true"
/>
</React.Fragment>
`;

Expand Down
14 changes: 7 additions & 7 deletions packages/rich-text/src/test/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ export const spec = [
endContainer: element.querySelector( 'ol > li' ).firstChild,
} ),
startPath: [ 0, 0, 0 ],
endPath: [ 0, 1, 1, 1, 0, 0, 1 ],
endPath: [ 0, 2, 1, 2, 0, 0, 1 ],
record: {
start: 0,
end: 9,
Expand Down Expand Up @@ -459,8 +459,8 @@ export const spec = [
endOffset: 0,
endContainer: element.querySelector( 'ul > li' ),
} ),
startPath: [ 0, 0, 0, 0, 0 ],
endPath: [ 0, 0, 0, 0, 0 ],
startPath: [ 0, 0, 0, 2, 0 ],
endPath: [ 0, 0, 0, 2, 0 ],
record: {
start: 1,
end: 1,
Expand All @@ -479,8 +479,8 @@ export const spec = [
endOffset: 0,
endContainer: element.firstChild.nextSibling,
} ),
startPath: [ 1, 0, 0 ],
endPath: [ 1, 0, 0 ],
startPath: [ 1, 2, 0 ],
endPath: [ 1, 2, 0 ],
record: {
start: 1,
end: 1,
Expand All @@ -498,8 +498,8 @@ export const spec = [
endOffset: 0,
endContainer: element.lastChild,
} ),
startPath: [ 1, 0, 0 ],
endPath: [ 1, 0, 0 ],
startPath: [ 1, 2, 0 ],
endPath: [ 1, 2, 0 ],
record: {
start: 4,
end: 4,
Expand Down
2 changes: 1 addition & 1 deletion packages/rich-text/src/to-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export function toTree( {
if (
isEditableTree &&
( nextCharacter === LINE_SEPARATOR || ! nextCharacter ) &&
i !== text.length
( i !== text.length || ! text.length )
) {
append( getParent( pointer ), padding );
}
Expand Down

0 comments on commit 690eb1c

Please sign in to comment.