Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.43k stars 1.99k forks source link

Gutenberg: Change primary action to Attempt Block Recovery #38329

Open gwwar opened 4 years ago

gwwar commented 4 years ago

Breaking out an actionable piece of https://github.com/Automattic/wp-calypso/issues/37230

This is a two parter:

Context

When a block parses HTML markup, it also tries to validate the data by re-serializing and comparing the result. Unfortunately blocks currently compare with an exact string match. Even a small whitespace for change for completely equivalent markup/styling, is enough to cause the following scary error:

Screen Shot 2019-10-31 at 10 21 49 AM

Clicking on the primary action usually isn't what the user wants. It converts the previously nice to understand block into a plain HTML block:

Screen Shot 2019-10-31 at 10 21 56 AM

The best action is usually "Attempt Block Recovery" or "Convert to Blocks"

Screen Shot 2019-10-31 at 10 23 29 AM

Traditionally WP allows manipulation of content from a variety of filters/customizations, so this is a very easy case to fall into.

jeraldjuice commented 4 years ago

Closing this for now, based on ongoing discussion in https://github.com/WordPress/gutenberg/pull/19188

gwwar commented 4 years ago

Please keep this one, as my try PR is very unlikely to make it in ;)

github-actions[bot] commented 3 years ago

This issue is stale because it has been 180 days with no activity. You can keep the issue open by adding a comment. If you do, please provide additional context and explain why you’d like it to remain open. You can also close the issue yourself — if you do, please add a brief explanation and apply one of relevant issue close labels.