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

Remove Subheading block #9353

Closed
wants to merge 1 commit into from
Closed

Remove Subheading block #9353

wants to merge 1 commit into from

Conversation

ZebulanStanphill
Copy link
Member

Description

Removed the Subheading block.

Fixes #9308 and closes #5475, #8141, #8234, and #8716.

How has this been tested?

Ran packaged version of my branch and tested it. Subheading blocks became Classic blocks, and there were no apparent errors anywhere.

Screenshots

image
(Ignore the extra buttons on the Classic block; those are added by Divi.)

Types of changes

This change is currently entirely file deletions and line removals of everything related to the Subheading (core/subhead) block.

Known issues

Using the Convert to Blocks option does not convert the content of the Classic blocks to Paragraph blocks. This seems to be due to the HTML comments; removing them makes the conversion work just fine. This same issue is occurring in #8821. It may be desirable to avoid merging both PRs until the solution to this issue is found.

Additionally, I noticed that even after removing the comments, there were still some issues with the conversion to a Paragraph block:

  • The wp-block-subhead class was not preserved and put in the Additional CSS Class field.
  • The inline text-align attribute on the <p> element was not preserved.

These seem to be issues with conversions from the Classic block in general, however. I think this is just another case of #6102. See also: #6878 and #7604.

I am not sure how many of these issues would be considered blockers. The text-align issue would be easily fixed by users by just setting the text alignment again, and I am doubtful that the wp-block-subhead class is being used enough to be that important about preserving in conversions. The HTML comment issue seems to be the biggest problem.

Related issues and PRs

@chrisvanpatten
Copy link
Contributor

chrisvanpatten commented Aug 25, 2018

Converting to classic feels like a step back for usability. Is there any precedent in Gutenberg for converting a deprecated block to a classic?

This feels like exactly the case that the deprecated handlers are designed to handle, for a smooth transition to a new block type.

@youknowriad
Copy link
Contributor

I wonder if we should just hide it like we did for the text columns block for now and add a Deprecated call.

@ZebulanStanphill
Copy link
Member Author

ZebulanStanphill commented Aug 25, 2018

@chrisvanpatten I don't think the deprecated block system can be used for converting from one block to a new one entirely. I think that is why the Text Columns block was not migrated to the Columns block, instead being removed from the inserter and marked as deprecated until it was removed 2 feature updates later. And speaking of which...

@youknowriad I had forgotten about what happened to the Text Columns block. I will open another PR for just deprecating the Subheading block.

I do wish the deprecated blocks system supported migrations from other/removed blocks. Is there any particular reason why this was not implemented, or was it simply overlooked?

@youknowriad
Copy link
Contributor

Is there any particular reason why this was not implemented, or was it simply overlooked?

I don't really know, it can be added later if necessary. There's still some improvements to make about how we handle old blocks.

@ZebulanStanphill
Copy link
Member Author

I have created a new PR (#9355) to deprecate the Subheading block, rather than remove it.

@ZebulanStanphill ZebulanStanphill deleted the remove/subheading-block branch August 25, 2018 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove sub heading Pressing Return in the subhead block does not create a new paragraph
3 participants