From 5ecc73b9b19e3cac9d837bdec587c5792211d1e5 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Mon, 24 May 2021 12:08:59 +0300 Subject: [PATCH] code improvement: no-string-literals in the rich-text package --- packages/rich-text/src/create.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/rich-text/src/create.js b/packages/rich-text/src/create.js index 344fed8834e8b7..a64c5d3bf3c58b 100644 --- a/packages/rich-text/src/create.js +++ b/packages/rich-text/src/create.js @@ -6,7 +6,7 @@ import { select } from '@wordpress/data'; /** * Internal dependencies */ - +import { store as richTextStore } from './store'; import { isFormatEqual } from './is-format-equal'; import { createElement } from './create-element'; import { mergePair } from './concat'; @@ -56,7 +56,7 @@ function toFormat( { type, attributes } ) { let formatType; if ( attributes && attributes.class ) { - formatType = select( 'core/rich-text' ).getFormatTypeForClassName( + formatType = select( richTextStore ).getFormatTypeForClassName( attributes.class ); @@ -73,7 +73,7 @@ function toFormat( { type, attributes } ) { } if ( ! formatType ) { - formatType = select( 'core/rich-text' ).getFormatTypeForBareElement( + formatType = select( richTextStore ).getFormatTypeForBareElement( type ); }