Paragraph element like Gutenberg Paragraph

I think Cwicly paragraph element needs improvement

I used to hit enter to break the paragraph into a new line with <p> tag.
With Cwicly’s paragraph element, it uses <br> instead of <p></p> no matter I hit Enter or Shift + Enter.

Logic
<br> when we hit Shift+Enter.
<p> when we hit Enter only.

See the screenshot below:

When I use the paragraph element by Gutenberg, it would break the paragraph with a new line with a new <p> tag when I hit enter. But I don’t want to use Gutenberg’s paragraph because I couldn’t style them with Cwicly’s setting.

Any feedback is welcome.

2 Likes

You can use a style blocker and set the styler class to the native para block to style.

There are some improvements in new version of Gutenberg to native para blocks. Core Editor Improvement: Advancing the writing experience – Make WordPress Core

Hoping all carries over to the Cwicly para blocks and it’s more of block style / variant then a fresh block.

1 Like

Yes, I have the same problem with Cwicly paragraph block when I hit enter it makes break instead of a new paragraph. I wish it worked more like a default Gutenberg paragraph block. Especially important when you copy a long text from some other document and paste it into Gutenberg, default paragraph block makes it nice in paragraphs according to the document but Cwicly block does not. It makes a break but this is not what I want mostly.

2 Likes

I have switched this thread to a feature request. I think it’s more suitable.

@Louis

Hi @jornes,

Thank you for bringing this one up again.
We have been working on this, although our specific logic for virtual classes means that splitting the paragraph is a bit more difficult.
Should be shipped soon nonetheless!

4 Likes

Looking forward to seeing that @Louis. Appreciate your effort, as always! :wink:

3 Likes

Thank you @Louis for the update on this!

You are my man. :heart_eyes:

1 Like

Agreed!
Amazing feedback and responsiveness!!
Thank you @Louis !

1 Like

This is so much better now. I love that you can hit enter to insert a new element, or just continue writing your paragraphs/headings.

3 Likes

True.
Also, switching between Headings and Paragraphs like Gutenberg with Cwicly’s element would be good.

Hi @jornes,

This is already possible :slight_smile:

2 Likes

Hi @Louis
I’ve tested. Once I switched the paragraph element by Cwicly to heading, it was switched to Heading by Gutenberg instead of heading by Cwicly.

Update:
Yes. It works. I didn’t aware that there were two different headings to choose. :blush:

2 Likes

@jornes If you are not using gutenberg core blocks like me then just use this code snippet. It will remove all the core gutenberg blocks and make the interface clutter free.

// Remove all core Gutenberg blocks
function jornes_remove_default_blocks($allowed_blocks){
 
    // Get all registered blocks
    $registered_blocks = WP_Block_Type_Registry::get_instance()->get_all_registered();
    
    // Remove all blocks that are prefixed with core/
    $filtered_blocks = array();
    foreach($registered_blocks as $block) {
     
      if(strpos($block->name , 'core/') === false) { 
        array_push($filtered_blocks, $block->name);
      }
    }
    
    return $filtered_blocks;
}

add_filter('allowed_block_types', 'jornes_remove_default_blocks');

5 Likes

@dranzer
Thank you for the snippet! I will consider seeing if I will use any core blocks before I disable them. :wink: :+1:

Just wanted to add, for a more granular selection and flexible approach, you can control all of the Gutenberg blocks inside the Editor itself, no matter from which plugin they come.

3 dot menu > Preferences > Blocks

2 Likes

@Marius Thanks for the hint. Are those settings user specific or apply site wide?

1 Like

I can’t answer that right away @anon32808828.
I also want to add that this option is not available inside the site and template editor, which is kind of a downside to be honest.
Not sure why there is no consistency, also regarding other preferences (options).

I don’t want to open a new feature request, as it’s just a small thing, but also has to do with the default behavior of paragraphs in Gutenberg:

Would it be possible to have a paragraph follow after inserting and labeling a headline and pressing RETURN (if it is the selected default block in the settings)? It speeds up pure text input quite a lot.

1 Like

Good point @Jugibur.
Default block will be inserted when pressing RETURN if not splitting the Heading block.

2 Likes

Hello @Jugibur,

This has been added in 1.2.8.1.
Thanks for taking the time to suggest it here.

1 Like