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

Button 2: Fancy class causes invalid block content error #421

Closed
KokkieH opened this issue Dec 10, 2018 · 5 comments
Closed

Button 2: Fancy class causes invalid block content error #421

KokkieH opened this issue Dec 10, 2018 · 5 comments
Labels
Support [Type] Bug Something isn't working
Milestone

Comments

@KokkieH
Copy link

KokkieH commented Dec 10, 2018

Steps to replicate

  1. Add an image block and insert an image
  2. Edit block in HTML mode, and add class fancy to the class attribute for the img tag.

Result

The block shows an invalid content warning which only goes away if the block is converted to an HTML block instead. The styling is replied to the image regardless, though.

edit_post_ shift_to_the_left _wordpress

Expected

For no errors to appear, and ideally for the styling to even be visible in the editor itself.

Should we update the instructions at https://button2demo.wordpress.com/fancy-image-corners/ to explain how to do this in the block editor? As the html for an image block is a bit different from the classic editor HTML shown there.

@KokkieH KokkieH added [Type] Bug Something isn't working Support labels Dec 10, 2018
@KokkieH KokkieH added this to the Button 2 milestone Dec 10, 2018
@laurelfulford
Copy link
Contributor

@KokkieH Thanks for the report!

The block shows an invalid content warning which only goes away if the block is converted to an HTML block instead.

Were you able to recreate just the error with another theme? This doesn't seem like it would be specific to Button 2, since its block editor support is really standard.

@KokkieH
Copy link
Author

KokkieH commented Dec 11, 2018

Hmm, I didn't think to test, as this class is specifically styled for Button, but you make a good point - someone may well want to add their own classes to blocks to then style with custom CSS, in which case it's causing an error with other themes as well, yes.

Looks like this happens in Core as well, and I've found a possibly related issue in WordPress/gutenberg#11054, so we can close this one, then as it's not a theme bug.

@KokkieH KokkieH closed this as completed Dec 11, 2018
@laurelfulford
Copy link
Contributor

Thanks for double-checking, @KokkieH!

I'm going to re-open this one, as it looks like Button 2 still doesn't have styles for the .fancy class in the editor -- I think this is a good suggestion to make sure the experience is truly WYSIWYG!

@laurelfulford
Copy link
Contributor

Just adding a note for follow-up:

I've styled the 'fancy' class in the editor when applied to the Image Block, and added an option to the Image Block to apply a block style that looks the same. The docs should probably be updated, at least to reference the latter; leaving this open until that is done.

@laurelfulford
Copy link
Contributor

I've added a one-liner and screenshot to the theme docs to cover this, so this issue should be good to close!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support [Type] Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants