Repository navigation
Fixes highlighting behaviour for posts converted from Classic to Gutenberg - #20667
Conversation
I wonder about this decision, did we decide not account for the cases you mentioned above because of technical challenges? When I read these two articles: How to Use the Classic Editor Block with WordPress Gutenberg and How to Use the WordPress Classic Block |
|
My rationale is that you could in principle do everything with the classic editor -- even add images for example -- so why would you then do that in other blocks, right? Or have two classic blocks? Also, if people do experience problems, we can always point them out that they can use the "convert to blocks" button. |
FAMarfuaty
left a comment
There was a problem hiding this comment.
The code looks good 🙌🏽 . And indeed I agree that this approach is the one that makes more sense.
My rationale is that you could in principle do everything with the classic editor -- even add images for example -- so why would you then do that in other blocks, right? Or have two classic blocks?
Also, if people do experience problems, we can always point them out that they can use the "convert to blocks" button.
I agree with this rationale. Also I was checking apparently when there are two consecutive classic blocks, both blocks are actually merged on post save. So the highlighting will still work (after the post is saved).
I was also looking if it's actually easier to just support annotating "core/freeform" blocks with Gutenberg annotation API, but it's actually more complicated that what I initially thought 😅
| */ | ||
| getInitialData( replaceVars ) { | ||
| const gutenbergData = this.collectGutenbergData( this.getPostAttribute ); | ||
| const gutenbergData = this.collectGutenbergData(); |
|
Acceptance 💯 |
Context
core/freeformblock (docs). Under the hood, the WordPressautopfunction (docs) is applied to these blocks (see e.g. this PR for context). Our new position-based highlighting functionality did not work in that case, because these<p>tags were not parts of the HTML that is stored in the database (they are removed on save throughremovep(docs)).Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
getEditedPostContentto fetch the content, which is functionally the same, but reads better thanthis.getPostAttribute( "content" ).Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Relevant test scenarios
Test instructions for QA when the code is in the RC
QA can test this PR by following these steps:
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
UI changes
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.Documentation
Quality assurance
Innovation
innovationlabel.Fixes https://github.com/Yoast/lingo-other-tasks/issues/217