Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gutenberg breaking blocks #13974

Closed
locksoft opened this issue Feb 20, 2019 · 2 comments
Closed

Gutenberg breaking blocks #13974

locksoft opened this issue Feb 20, 2019 · 2 comments
Labels
[Feature] Shortcodes Related to shortcode functionality

Comments

@locksoft
Copy link

locksoft commented Feb 20, 2019

Sorry if it's a duplicate. I tried to do a search in the issues but I've found anything about it.

Describe the bug
Gutenberg always tries to "break" most for my HTML blocks. For example I've this one:

https://postimg.cc/qtgBLvQ8

It's a collapse-o-matic expand shortcode with some text paragraphs inside.

Every time I save the article and open again I get this error:

https://postimg.cc/xqPCnhkN

Sorry for italian language, it says more or less "this block contains unexpected or invalid content".

"Solving" always removes somethings, usually html tags, so it's not a viable way, so I choose "convert to HTML". But it's weird: the block was already an HTML block!
Anyway, next time I open the article, I get the same issue.

I know there's a shortcode dedicated block but usually it gives me even more problems so I'm sticking with HTML blocks.

I'd like Gutenberg not trying to guess if what I wrote is right or wrong. I undertand that some wrong closing code could take to a disaster but I'm up to take the risks.

When this warning happens my code is already gone. From here I cannot get the original one to copy and paste or other. I can only leave the article, disable Gutenberg, re-open the article with classic editor, copy the block code, re-enable Gutenberg and paste again the code (that will be spoiled next time).

Anyway, the specific HTML code I've shown in the images above is not wrong, why Gutenberg complains?

Sometimes I need to use more complex text inside an [expand] shortcode, like:

[expand title="<span class='light'>Hello</span>"]

I know it's not a wonderful HTML code, and I understand why Gutenberg could complain. But it's not wrong, just ugly. I'd like it could trust me and my code blocks. :)

I'm using Gutenberg 5.1.0.

To Reproduce
Just try the code I've included in the first image.

Expected behavior
I'd like Gutenberg not trying to tell me if my blocks are "right or wrong". :P

Screenshots
See the images above.

Desktop (please complete the following information):

  • OS: MacOs High Sierra version 10.13.6
  • Browser Firefox version 65.0.1

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
@draganescu
Copy link
Contributor

draganescu commented Mar 13, 2019

Hey @locksoft I tried to reproduce using this code below:


[expand title="<strong>I Mac sonno troppo costosi</strong>" notitle="true" expanded="true"]
<p class="light">Sed ut perspiciatis unde omnis iste natus error sit voluptatem (2003)</p>
<p> accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. </p>
[/expand]

I have Collapse-O-Matic installed and it works like a charm. Also no matter how many times I tried to break it, it always remained the same HTML block in Gutenberg. I tried with both HTML blocks and shortcode blocks, both remain unchanged when reopening.

I am using the latest WP 5.1 with Gutenberg and the classic editor plugin.

I will close this issue, if you still see the problem using the latest WP let us know and I'll reopen it.

@draganescu draganescu added the [Feature] Shortcodes Related to shortcode functionality label Mar 13, 2019
@locksoft
Copy link
Author

I guess the last versions of Gutenberg improved, as I didn't have this issue anymore.
Thanks for your answer, have a nice day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Shortcodes Related to shortcode functionality
Projects
None yet
Development

No branches or pull requests

2 participants