From 804abecb7fee1acfbc764a9d6a1028ecf55b72c3 Mon Sep 17 00:00:00 2001 From: Matthew Riley MacPherson Date: Wed, 25 Jul 2018 12:56:19 +0100 Subject: [PATCH] Allow double quotes and template string sometimes (#7555) * chore: Allow double quotes when strings contain single quotes Fixes #7366 --- .eslintrc.js | 2 +- core-blocks/categories/index.js | 2 +- core-blocks/columns/index.js | 2 +- core-blocks/freeform/index.js | 2 +- core-blocks/image/index.js | 2 +- core-blocks/more/index.js | 2 +- core-blocks/subhead/index.js | 2 +- core-blocks/test/full-content.js | 10 +++--- docs/reference/coding-guidelines.md | 35 +++++++++++++++++++ docs/tool/config.js | 4 +-- .../components/autocompleters/test/block.js | 2 +- .../test/block-mode-toggle.js | 2 +- editor/components/post-author/test/check.js | 4 +-- .../post-pending-status/test/check.js | 2 +- .../post-publish-panel/postpublish.js | 2 +- .../post-publish-panel/prepublish.js | 2 +- editor/components/post-schedule/test/check.js | 2 +- editor/components/post-sticky/test/index.js | 2 +- .../components/post-visibility/test/check.js | 2 +- .../template-validation-notice/index.js | 2 +- .../theme-support-check/test/index.js | 6 ++-- editor/store/test/reducer.js | 2 +- editor/store/test/selectors.js | 4 +-- eslint/config.js | 1 + lib/class-wp-rest-blocks-controller.php | 4 +-- .../api-fetch/src/middlewares/test/http-v1.js | 2 +- packages/autop/src/test/index.test.js | 2 +- packages/babel-plugin-makepot/test/index.js | 12 +++---- packages/blocks/src/api/test/factory.js | 4 +-- packages/blocks/src/api/test/parser.js | 16 ++++----- packages/blocks/src/api/test/serializer.js | 2 +- packages/blocks/src/api/test/templates.js | 4 +-- packages/blocks/src/api/test/validation.js | 4 +-- .../components/src/autocomplete/test/index.js | 2 +- .../components/src/disabled/test/index.js | 4 +-- .../with-focus-outside/test/index.js | 2 +- packages/components/src/popover/test/utils.js | 14 ++++---- .../components/src/slot-fill/test/slot.js | 2 +- .../src/remount-on-prop-change/test/index.js | 2 +- packages/core-data/src/test/entities.js | 14 ++++---- packages/core-data/src/test/selectors.js | 2 +- packages/data/src/test/persist.js | 2 +- packages/dom/src/test/dom.js | 12 +++---- packages/shortcode/src/test/index.js | 6 ++-- packages/url/src/test/index.test.js | 16 ++++----- packages/wordcount/src/test/index.test.js | 2 +- post-content.js | 20 +++++------ test/e2e/specs/adding-blocks.test.js | 2 +- test/e2e/specs/change-detection.test.js | 2 +- test/e2e/specs/managing-links.test.js | 2 +- test/e2e/specs/nux.test.js | 4 +-- test/e2e/support/utils.js | 4 +-- 52 files changed, 149 insertions(+), 113 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index f4170bb996e7a..d0214a16984c7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -130,7 +130,7 @@ module.exports = { }, { selector: 'ImportDeclaration[source.value="lodash"] Identifier.imported[name="memoize"]', - message: 'Use memize instead of Lodash\'s memoize', + message: 'Use memize instead of Lodash’s memoize', }, { selector: 'CallExpression[callee.object.name="page"][callee.property.name="waitFor"]', diff --git a/core-blocks/categories/index.js b/core-blocks/categories/index.js index b69986dbe1227..e71098a103e1a 100644 --- a/core-blocks/categories/index.js +++ b/core-blocks/categories/index.js @@ -14,7 +14,7 @@ export const name = 'core/categories'; export const settings = { title: __( 'Categories' ), - description: __( 'Display a list of all your site\'s categories.' ), + description: __( 'Display a list of all your site’s categories.' ), icon: 'list-view', diff --git a/core-blocks/columns/index.js b/core-blocks/columns/index.js index 3d7320c7168f7..0243d4823a298 100644 --- a/core-blocks/columns/index.js +++ b/core-blocks/columns/index.js @@ -66,7 +66,7 @@ export const settings = { }, }, - description: __( 'Add a block that displays content in multiple columns, then add whatever content blocks you\'d like.' ), + description: __( 'Add a block that displays content in multiple columns, then add whatever content blocks you’d like.' ), supports: { align: [ 'wide', 'full' ], diff --git a/core-blocks/freeform/index.js b/core-blocks/freeform/index.js index 711fb3b7768d8..0770d50cad8d4 100644 --- a/core-blocks/freeform/index.js +++ b/core-blocks/freeform/index.js @@ -14,7 +14,7 @@ export const name = 'core/freeform'; export const settings = { title: __( 'Classic' ), - description: __( 'It\'s the classic WordPress editor and it\'s a block! Drop the editor right in.' ), + description: __( 'It’s the classic WordPress editor and it’s a block! Drop the editor right in.' ), icon: 'editor-kitchensink', diff --git a/core-blocks/image/index.js b/core-blocks/image/index.js index 361aee8b548e2..3cf3ff04e6c93 100644 --- a/core-blocks/image/index.js +++ b/core-blocks/image/index.js @@ -93,7 +93,7 @@ const schema = { export const settings = { title: __( 'Image' ), - description: __( 'They\'re worth 1,000 words! Insert a single image.' ), + description: __( 'They’re worth 1,000 words! Insert a single image.' ), icon: 'format-image', diff --git a/core-blocks/more/index.js b/core-blocks/more/index.js index c62c7e220a96e..75187406f33e1 100644 --- a/core-blocks/more/index.js +++ b/core-blocks/more/index.js @@ -20,7 +20,7 @@ export const name = 'core/more'; export const settings = { title: __( 'More' ), - description: __( 'Want to show only part of this post on your blog\'s home page? Insert a "More" block where you want the split.' ), + description: __( 'Want to show only part of this post on your blog’s home page? Insert a "More" block where you want the split.' ), icon: 'editor-insertmore', diff --git a/core-blocks/subhead/index.js b/core-blocks/subhead/index.js index 6486ac14fe16d..552d91ce47c73 100644 --- a/core-blocks/subhead/index.js +++ b/core-blocks/subhead/index.js @@ -21,7 +21,7 @@ export const name = 'core/subhead'; export const settings = { title: __( 'Subheading' ), - description: __( 'What\'s a subhead? Smaller than a headline, bigger than basic text.' ), + description: __( 'What’s a subhead? Smaller than a headline, bigger than basic text.' ), icon: 'text', diff --git a/core-blocks/test/full-content.js b/core-blocks/test/full-content.js index 66155153cf99f..63687cbe62731 100644 --- a/core-blocks/test/full-content.js +++ b/core-blocks/test/full-content.js @@ -146,7 +146,7 @@ describe( 'full post content fixture', () => { ).toEqual( parserOutputExpected ); } catch ( err ) { throw new Error( format( - 'File \'%s.parsed.json\' does not match expected value:\n\n%s', + "File '%s.parsed.json' does not match expected value:\n\n%s", f, err.message ) ); @@ -188,7 +188,7 @@ describe( 'full post content fixture', () => { ).toEqual( blocksExpected ); } catch ( err ) { throw new Error( format( - 'File \'%s.json\' does not match expected value:\n\n%s', + "File '%s.json' does not match expected value:\n\n%s", f, err.message ) ); @@ -214,7 +214,7 @@ describe( 'full post content fixture', () => { expect( serializedActual ).toEqual( serializedExpected ); } catch ( err ) { throw new Error( format( - 'File \'%s.serialized.html\' does not match expected value:\n\n%s', + "File '%s.serialized.html' does not match expected value:\n\n%s", f, err.message ) ); @@ -253,7 +253,7 @@ describe( 'full post content fixture', () => { if ( ! foundFixtures.length ) { errors.push( format( - 'Expected a fixture file called \'%s.html\' or \'%s__*.html\'.', + "Expected a fixture file called '%s.html' or '%s__*.html'.", nameToFilename, nameToFilename ) ); @@ -262,7 +262,7 @@ describe( 'full post content fixture', () => { foundFixtures.forEach( ( fixture ) => { if ( name !== fixture.firstBlock ) { errors.push( format( - 'Expected fixture file \'%s\' to test the \'%s\' block.', + "Expected fixture file '%s' to test the '%s' block.", fixture.filename, name ) ); diff --git a/docs/reference/coding-guidelines.md b/docs/reference/coding-guidelines.md index ca74c69212293..dcc943b3288ae 100644 --- a/docs/reference/coding-guidelines.md +++ b/docs/reference/coding-guidelines.md @@ -168,6 +168,41 @@ An exception to camel case is made for constant values which are never intended In almost all cases, a constant should be defined in the top-most scope of a file. It is important to note that [JavaScript's `const` assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const) is conceptually more limited than what is implied here, where a value assigned by `const` in JavaScript can in-fact be mutated, and is only protected against reassignment. A constant as defined in these coding guidelines applies only to values which are expected to never change, and is a strategy for developers to communicate intent moreso than it is a technical restriction. +### Strings + +String literals should be declared with single-quotes *unless* the string itself contains a single-quote that would need to be escaped–in that case: use a double-quote. If the string contains a single-quote *and* a double-quote, you can use ES6 template strings to avoid escaping the quotes. + +**Note:** The single-quote character (`'`) should never be used in place of an apostrophe (`’`) for words like `it’s` or `haven’t` in user-facing strings. For test code it's still encouraged to use a real apostrophe. + +In general, avoid backslash-escaping quotes: + +```js +// Bad: +const name = "Matt"; +// Good: +const name = 'Matt'; + +// Bad: +const pet = 'Matt\'s dog'; +// Also bad (not using an apostrophe): +const pet = "Matt's dog"; +// Good: +const pet = 'Matt’s dog'; +// Also good: +const oddString = "She said 'This is odd.'"; +``` + +You should use ES6 Template Strings over string concatenation whenever possible: + +```js +const name = 'Stacey'; + +// Bad: +alert( 'My name is ' + name + '.' ); +// Good: +alert( `My name is ${ name }.` ); +``` + ## PHP We use diff --git a/docs/tool/config.js b/docs/tool/config.js index 9d8f65ab18927..e6c9bd9717207 100644 --- a/docs/tool/config.js +++ b/docs/tool/config.js @@ -32,12 +32,12 @@ module.exports = { actions: [ path.resolve( root, 'packages/blocks/src/store/actions.js' ) ], }, 'core/editor': { - title: 'The Editor\'s Data', + title: 'The Editor’s Data', selectors: [ path.resolve( root, 'editor/store/selectors.js' ) ], actions: [ path.resolve( root, 'editor/store/actions.js' ) ], }, 'core/edit-post': { - title: 'The Editor\'s UI Data', + title: 'The Editor’s UI Data', selectors: [ path.resolve( root, 'edit-post/store/selectors.js' ) ], actions: [ path.resolve( root, 'edit-post/store/actions.js' ) ], }, diff --git a/editor/components/autocompleters/test/block.js b/editor/components/autocompleters/test/block.js index 379433adf858f..d5dd74d2a5b05 100644 --- a/editor/components/autocompleters/test/block.js +++ b/editor/components/autocompleters/test/block.js @@ -82,7 +82,7 @@ describe( 'block', () => { expect( labelComponents.at( 1 ).text() ).toBe( 'expected-text' ); } ); - it( 'should derive isOptionDisabled from the item\'s isDisabled', () => { + it( "should derive isOptionDisabled from the item's isDisabled", () => { const disabledInserterItem = { name: 'core/foo', title: 'foo', diff --git a/editor/components/block-settings-menu/test/block-mode-toggle.js b/editor/components/block-settings-menu/test/block-mode-toggle.js index 203c059ac8f34..026f03c528dd9 100644 --- a/editor/components/block-settings-menu/test/block-mode-toggle.js +++ b/editor/components/block-settings-menu/test/block-mode-toggle.js @@ -9,7 +9,7 @@ import { shallow } from 'enzyme'; import { BlockModeToggle } from '../block-mode-toggle'; describe( 'BlockModeToggle', () => { - it( 'should not render the HTML mode button if the block doesn\'t support it', () => { + it( "should not render the HTML mode button if the block doesn't support it", () => { const wrapper = shallow( ); diff --git a/editor/components/post-author/test/check.js b/editor/components/post-author/test/check.js index 93f6bf1b5b55c..891068ef12c52 100644 --- a/editor/components/post-author/test/check.js +++ b/editor/components/post-author/test/check.js @@ -49,7 +49,7 @@ describe( 'PostAuthorCheck', () => { expect( wrapper.type() ).toBe( null ); } ); - it( 'should not render anything if doesn\'t have author action', () => { + it( "should not render anything if doesn't have author action", () => { const wrapper = shallow( authors @@ -58,7 +58,7 @@ describe( 'PostAuthorCheck', () => { expect( wrapper.type() ).toBe( null ); } ); - it( 'should render control', () => { + it( 'should render control', () => { const wrapper = shallow( authors diff --git a/editor/components/post-pending-status/test/check.js b/editor/components/post-pending-status/test/check.js index af28ca98036e5..b26eebb7331be 100644 --- a/editor/components/post-pending-status/test/check.js +++ b/editor/components/post-pending-status/test/check.js @@ -9,7 +9,7 @@ import { shallow } from 'enzyme'; import { PostPendingStatusCheck } from '../check'; describe( 'PostPendingStatusCheck', () => { - it( 'should not render anything if the user doesn\'t have the right capabilities', () => { + it( "should not render anything if the user doesn't have the right capabilities", () => { const wrapper = shallow( status diff --git a/editor/components/post-publish-panel/postpublish.js b/editor/components/post-publish-panel/postpublish.js index f8c5591be5689..2318937afaf49 100644 --- a/editor/components/post-publish-panel/postpublish.js +++ b/editor/components/post-publish-panel/postpublish.js @@ -56,7 +56,7 @@ class PostPublishPanelPostpublish extends Component { __( 'is now live.' ); const postPublishBodyText = isScheduled ? __( 'The post address will be:' ) : - __( 'What\'s next?' ); + __( 'What’s next?' ); return (
diff --git a/editor/components/post-publish-panel/prepublish.js b/editor/components/post-publish-panel/prepublish.js index 8a26baf66c3d2..28071f8c10614 100644 --- a/editor/components/post-publish-panel/prepublish.js +++ b/editor/components/post-publish-panel/prepublish.js @@ -26,7 +26,7 @@ function PostPublishPanelPrepublish( { return (
{ hasPublishAction ? __( 'Are you ready to publish?' ) : __( 'Are you ready to submit for review?' ) }
-

{ hasPublishAction ? __( 'Here, you can do a last-minute check up of your settings below, before you publish.' ) : __( 'When you\'re ready, submit your work for review, and an Editor will be able to approve it for you.' ) }

+

{ hasPublishAction ? __( 'Here, you can do a last-minute check up of your settings below, before you publish.' ) : __( 'When you’re ready, submit your work for review, and an Editor will be able to approve it for you.' ) }

{ hasPublishAction && ( { - it( 'should not render anything if the user doesn\'t have the right capabilities', () => { + it( "should not render anything if the user doesn't have the right capabilities", () => { const wrapper = shallow( yes ); expect( wrapper.type() ).toBe( null ); } ); diff --git a/editor/components/post-sticky/test/index.js b/editor/components/post-sticky/test/index.js index 716b48b13f14d..ca6440734a152 100644 --- a/editor/components/post-sticky/test/index.js +++ b/editor/components/post-sticky/test/index.js @@ -18,7 +18,7 @@ describe( 'PostSticky', () => { expect( wrapper.type() ).toBe( null ); } ); - it( 'should not render anything if post doesn\'t support stickying', () => { + it( "should not render anything if post doesn't support stickying", () => { const wrapper = shallow( Can Toggle Sticky diff --git a/editor/components/post-visibility/test/check.js b/editor/components/post-visibility/test/check.js index d719680f0bdcd..c64e73f663163 100644 --- a/editor/components/post-visibility/test/check.js +++ b/editor/components/post-visibility/test/check.js @@ -11,7 +11,7 @@ import { PostVisibilityCheck } from '../check'; describe( 'PostVisibilityCheck', () => { const render = ( { canEdit } ) => ( canEdit ? 'yes' : 'no' ); - it( 'should not render the edit link if the user doesn\'t have the right capability', () => { + it( "should not render the edit link if the user doesn't have the right capability", () => { const wrapper = shallow( ); expect( wrapper.text() ).toBe( 'no' ); } ); diff --git a/editor/components/template-validation-notice/index.js b/editor/components/template-validation-notice/index.js index 39cc0c1aacfba..f1a8ccfd1bddd 100644 --- a/editor/components/template-validation-notice/index.js +++ b/editor/components/template-validation-notice/index.js @@ -25,7 +25,7 @@ function TemplateValidationNotice( { isValid, ...props } ) { return ( -

{ __( 'The content of your post doesn\'t match the template assigned to your post type.' ) }

+

{ __( 'The content of your post doesn’t match the template assigned to your post type.' ) }

diff --git a/editor/components/theme-support-check/test/index.js b/editor/components/theme-support-check/test/index.js index 2514778391141..0d1d2d9df13a7 100644 --- a/editor/components/theme-support-check/test/index.js +++ b/editor/components/theme-support-check/test/index.js @@ -9,7 +9,7 @@ import { shallow } from 'enzyme'; import { ThemeSupportCheck } from '../index'; describe( 'ThemeSupportCheck', () => { - it( 'should not render if there\'s no support check provided', () => { + it( "should not render if there's no support check provided", () => { const wrapper = shallow( foobar ); expect( wrapper.type() ).toBe( null ); } ); @@ -37,7 +37,7 @@ describe( 'ThemeSupportCheck', () => { expect( wrapper.type() ).not.toBe( null ); } ); - it( 'should not render if post-thumbnails aren\'t supported for the post type', () => { + it( "should not render if post-thumbnails aren't supported for the post type", () => { const themeSupports = { 'post-thumbnails': [ 'post' ], }; @@ -61,7 +61,7 @@ describe( 'ThemeSupportCheck', () => { expect( wrapper.type() ).toBe( null ); } ); - it( 'should not render if theme doesn\'t support post-thumbnails', () => { + it( "should not render if theme doesn't support post-thumbnails", () => { const themeSupports = { 'post-thumbnails': false, }; diff --git a/editor/store/test/reducer.js b/editor/store/test/reducer.js index bb2c7234ed2c6..36cb0a35ec790 100644 --- a/editor/store/test/reducer.js +++ b/editor/store/test/reducer.js @@ -1968,7 +1968,7 @@ describe( 'state', () => { } ); } ); - it( 'should update the shared block\'s id if it was temporary', () => { + it( "should update the shared block's id if it was temporary", () => { const initialState = { data: { shared1: { clientId: '', title: '' }, diff --git a/editor/store/test/selectors.js b/editor/store/test/selectors.js index fb411be0b04f2..b2db14746df38 100644 --- a/editor/store/test/selectors.js +++ b/editor/store/test/selectors.js @@ -395,7 +395,7 @@ describe( 'selectors', () => { } ); describe( 'getEditedPostAttribute', () => { - it( 'should return the current post\'s slug if no edits have been made', () => { + it( 'should return the current post’s slug if no edits have been made', () => { const state = { currentPost: { slug: 'post slug' }, editor: { @@ -3870,7 +3870,7 @@ describe( 'selectors', () => { } ); } ); - it( 'should return undefined if settings for the block don\'t exist', () => { + it( 'should return undefined if settings for the block don’t exist', () => { const state = { blockListSettings: {}, }; diff --git a/eslint/config.js b/eslint/config.js index 9e15ac3a2761e..24b8c5ff0bbd2 100644 --- a/eslint/config.js +++ b/eslint/config.js @@ -99,6 +99,7 @@ module.exports = { 'no-whitespace-before-property': 'error', 'object-curly-spacing': [ 'error', 'always' ], 'padded-blocks': [ 'error', 'never' ], + quotes: [ 'error', 'single', { allowTemplateLiterals: true, avoidEscape: true } ], 'quote-props': [ 'error', 'as-needed' ], 'react/display-name': 'off', 'react/jsx-curly-spacing': [ 'error', { diff --git a/lib/class-wp-rest-blocks-controller.php b/lib/class-wp-rest-blocks-controller.php index 7435c63e56b9e..4ee9c430cee6e 100644 --- a/lib/class-wp-rest-blocks-controller.php +++ b/lib/class-wp-rest-blocks-controller.php @@ -108,12 +108,12 @@ public function get_item_schema() { 'readonly' => true, ), 'title' => array( - 'description' => __( 'The block\'s title.', 'gutenberg' ), + 'description' => __( 'The block’s title.', 'gutenberg' ), 'type' => 'string', 'required' => true, ), 'content' => array( - 'description' => __( 'The block\'s HTML content.', 'gutenberg' ), + 'description' => __( 'The block’s HTML content.', 'gutenberg' ), 'type' => 'string', 'required' => true, ), diff --git a/packages/api-fetch/src/middlewares/test/http-v1.js b/packages/api-fetch/src/middlewares/test/http-v1.js index 00873ad83756c..c0f993f86f555 100644 --- a/packages/api-fetch/src/middlewares/test/http-v1.js +++ b/packages/api-fetch/src/middlewares/test/http-v1.js @@ -15,7 +15,7 @@ describe( 'HTTP v1 Middleware', () => { httpV1Middleware( { method: 'PUT', data: {} }, callback ); } ); - it( 'shouldn\'t touch the options for GET requests', () => { + it( "shouldn't touch the options for GET requests", () => { expect.hasAssertions(); const requestOptions = { method: 'GET', path: '/wp/v2/posts' }; diff --git a/packages/autop/src/test/index.test.js b/packages/autop/src/test/index.test.js index 5bebc78aee366..ea8e4c605343e 100644 --- a/packages/autop/src/test/index.test.js +++ b/packages/autop/src/test/index.test.js @@ -76,7 +76,7 @@ done = 0; str = `Look at this code\n\n
${ code }
\n\nIsn't that cool?`; // Expected text after autop - let expected = '

Look at this code

\n
' + code + '
\n

Isn\'t that cool?

'; + let expected = `

Look at this code

\n
${ code }
\n

Isn't that cool?

`; expect( autop( str ).trim() ).toBe( expected ); // Make sure HTML breaks are maintained if manually inserted diff --git a/packages/babel-plugin-makepot/test/index.js b/packages/babel-plugin-makepot/test/index.js index 14137de42678d..17af021380b9e 100644 --- a/packages/babel-plugin-makepot/test/index.js +++ b/packages/babel-plugin-makepot/test/index.js @@ -56,37 +56,37 @@ describe( 'babel-plugin', () => { } it( 'should not return translator comment on same line but after call expression', () => { - const comment = getCommentFromString( '__( \'Hello world\' ); // translators: Greeting' ); + const comment = getCommentFromString( "__( 'Hello world' ); // translators: Greeting" ); expect( comment ).toBeUndefined(); } ); it( 'should return translator comment on leading comments', () => { - const comment = getCommentFromString( '// translators: Greeting\n__( \'Hello world\' );' ); + const comment = getCommentFromString( "// translators: Greeting\n__( 'Hello world' );" ); expect( comment ).toBe( 'Greeting' ); } ); it( 'should be case insensitive to translator prefix', () => { - const comment = getCommentFromString( '// TrANslAtORs: Greeting\n__( \'Hello world\' );' ); + const comment = getCommentFromString( "// TrANslAtORs: Greeting\n__( 'Hello world' );" ); expect( comment ).toBe( 'Greeting' ); } ); it( 'should traverse up parents until it encounters comment', () => { - const comment = getCommentFromString( '// translators: Greeting\nconst string = __( \'Hello world\' );' ); + const comment = getCommentFromString( "// translators: Greeting\nconst string = __( 'Hello world' );" ); expect( comment ).toBe( 'Greeting' ); } ); it( 'should not consider comment if it does not end on same or previous line', () => { - const comment = getCommentFromString( '// translators: Greeting\n\n__( \'Hello world\' );' ); + const comment = getCommentFromString( "// translators: Greeting\n\n__( 'Hello world' );" ); expect( comment ).toBeUndefined(); } ); it( 'should use multi-line comment starting many lines previous', () => { - const comment = getCommentFromString( '/* translators: Long comment\nspanning multiple \nlines */\nconst string = __( \'Hello world\' );' ); + const comment = getCommentFromString( "/* translators: Long comment\nspanning multiple \nlines */\nconst string = __( 'Hello world' );" ); expect( comment ).toBe( 'Long comment spanning multiple lines' ); } ); diff --git a/packages/blocks/src/api/test/factory.js b/packages/blocks/src/api/test/factory.js index 015f2686d4098..12363de75f072 100644 --- a/packages/blocks/src/api/test/factory.js +++ b/packages/blocks/src/api/test/factory.js @@ -629,7 +629,7 @@ describe( 'block factory', () => { expect( availableBlocks ).toEqual( [] ); } ); - it( 'for a non multiblock transform, the isMatch function receives the source block\'s attributes object as its first argument', () => { + it( 'for a non multiblock transform, the isMatch function receives the source block’s attributes object as its first argument', () => { const isMatch = jest.fn(); registerBlockType( 'core/updated-text-block', { @@ -661,7 +661,7 @@ describe( 'block factory', () => { expect( isMatch ).toHaveBeenCalledWith( { value: 'ribs' } ); } ); - it( 'for a multiblock transform, the isMatch function receives an array containing every source block\'s attributes as its first argument', () => { + it( 'for a multiblock transform, the isMatch function receives an array containing every source block’s attributes as its first argument', () => { const isMatch = jest.fn(); registerBlockType( 'core/updated-text-block', { diff --git a/packages/blocks/src/api/test/parser.js b/packages/blocks/src/api/test/parser.js index 0b811b9d9a279..3c12fee973ff4 100644 --- a/packages/blocks/src/api/test/parser.js +++ b/packages/blocks/src/api/test/parser.js @@ -137,7 +137,7 @@ describe( 'block parser', () => { } ); describe( 'parseWithAttributeSchema', () => { - it( 'should return the matcher\'s attribute value', () => { + it( 'should return the matcher’s attribute value', () => { const value = parseWithAttributeSchema( '
chicken
', { @@ -149,7 +149,7 @@ describe( 'block parser', () => { expect( value ).toBe( 'chicken' ); } ); - it( 'should return the matcher\'s string attribute value', () => { + it( 'should return the matcher’s string attribute value', () => { const value = parseWithAttributeSchema( '