Title: Justify
Last modified: April 24, 2022

---

# Justify

 *  [EasyNT](https://wordpress.org/support/users/easynt/)
 * (@easynt)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/justify-3/)
 * Hi there,
 * Thanks for the great plugin! I’ve installed it on a site currently under development(
   WP 5.93), but text marked as justify in the Gutenberg editor does not appear 
   justified. It does on the frontend of the site, but not in the edtor. When I 
   check the code with edit as HTML, however, it correctly shows the paragraph with
   class=”has-text-align-justify”.
 * I already tried different browsers and cleared the cache – no luck.
 * Any help would be appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Munir Kamal](https://wordpress.org/support/users/munirkamal/)
 * (@munirkamal)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/justify-3/#post-15591286)
 * Hey [@easynt](https://wordpress.org/support/users/easynt/)
 * I’ve re-check this, and it seems to work fine for me. Here’s a quick screencast
   to show you.
    [https://share.getcloudapp.com/o0uR14KJ](https://share.getcloudapp.com/o0uR14KJ)
 * I guess that has to do with one of your installed plugins or the theme you are
   using. I advise you to check by disabling all other plugins and changing your
   theme to test.
 * Let me know.
 *  Thread Starter [EasyNT](https://wordpress.org/support/users/easynt/)
 * (@easynt)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/justify-3/#post-15593380)
 * Hi there Munir,
 * Thanks for looking into it. I tried disabling all plugins, I changed the theme
   to twentytwentytwo, still the same. I figured out what’s the cause, but I don’t
   see how to prevent it.
 * A block paragraph in the back end looks something like this:
 * `<p role="document" aria-multiline="true" aria-label="Paragraph block" class="
   block-editor-rich-text__editable block-editor-block-list__block wp-block has-
   text-align-justify is-selected wp-block-paragraph rich-text" id="block-f826f922-
   1633-46ae-94bb-ab7e73c58c29" tabindex="0" data-block="f826f922-1633-46ae-94bb-
   ab7e73c58c29" data-type="core/paragraph" data-title="Paragraph" data-empty="false"
   contenteditable="true" style="white-space: pre-wrap; min-width: 1px;">`
 * Now what’s causing the justify to not happen is this part at the end:
 * `style="white-space: pre-wrap; min-width: 1px;"`
 * Somehow the extra style part prevents the justify from happening. It seems this
   is coming from Word Press (5.93) itself. How does the code on a block paragraph
   look like on your version of the screencast?
 * Any ideas what I could do?
 * Thanks, Juerg
 *  Plugin Author [Munir Kamal](https://wordpress.org/support/users/munirkamal/)
 * (@munirkamal)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/justify-3/#post-15605404)
 * Hey [@easynt](https://wordpress.org/support/users/easynt/)
 * I don’t think those styles are added by WP 5.9.3 by default. Here’s another screencast
   on a fresh WP install with EditorsKit enabled.
 * [https://share.getcloudapp.com/Bluo6L59](https://share.getcloudapp.com/Bluo6L59)
 * I would advise you to test this on a new page as the content on the current page
   may have been manipulated already by some other plugin.
 * Let me know.
 *  Thread Starter [EasyNT](https://wordpress.org/support/users/easynt/)
 * (@easynt)
 * [4 years ago](https://wordpress.org/support/topic/justify-3/#post-15682398)
 * Hi there Munir,
 * Thanks again for your response. It took me a while, but I was finally able to
   track down where this
 * `style="white-space: pre-wrap; min-width: 1px;"`
 * is coming from. It is actually from a WordPress-included JavaScript, /wp-includes/
   js/dist/rich-text.js:
 *     ```
       3778 const whiteSpace = 'pre-wrap';
       3779 /**
       3780  * A minimum width of 1px will prevent the rich text container from collapsing
       3781  * to 0 width and hiding the caret. This is useful for inline containers.
       3782  */
       3783 
       3784 const minWidth = '1px';
       3785 function useDefaultStyle() {
       3786   return (0,external_wp_element_namespaceObject.useCallback)(element => {
       3787     if (!element) return;
       3788     element.style.whiteSpace = whiteSpace;
       3789     element.style.minWidth = minWidth;
       3790   }, []);
       3791 }
       ```
   
 * Actually it’s mimimized form is used, /wp-includes/js/dist/rich-text.min.js. 
   If I remove the contents ‘pre-wrap’ and ‘1px’ from there, everything is fine 
   and justify works in the editor. I don’t know why this is not the case in your
   screencasts, though. But it’s clearly coming from this JavaScript from WordPress
   itself. One probably has to dig a little deeper to find out what this JavaScript
   is intended for and why it’s fireing here and not in your screencasts…

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Justify’ is closed to new replies.

 * ![](https://ps.w.org/block-options/assets/icon-256x256.jpg?rev=2610578)
 * [Gutenberg Block Editor Toolkit – EditorsKit](https://wordpress.org/plugins/block-options/)
 * [Support Threads](https://wordpress.org/support/plugin/block-options/)
 * [Active Topics](https://wordpress.org/support/plugin/block-options/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/block-options/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/block-options/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [EasyNT](https://wordpress.org/support/users/easynt/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/justify-3/#post-15682398)
 * Status: not resolved