[IM] Highlighting feature: Enable highlighting text containing html tags in Classic editor and make sure yoastmark doesn't corrupt anchor tags in Shopify#19688
Merged
FAMarfuaty merged 11 commits intotrunkfrom Jan 23, 2023
Conversation
15 tasks
Contributor
Author
|
I smoked test this PR both in WP and in Shopify: looks like things still works well. |
Contributor
|
QA ✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
catnipalso occurred in the url in the anchor).Summary
This PR can be summarized in the following changelog entry:
yoastmarktags broke the HTML when applied to inline HTML attributes.yoastmarkto anchor tag attributes.Relevant technical choices:
getSentencesFromTokens, a check was added. Previously, if there was an opening tag on the beginning of the text, and a closing tag at the end, both would be removed, regardless of whether they belonged together. In this PR a check is added that does a rudimentary (and not watertight) check whether they belong together. Once we have the html parser, this should be replaced.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
NOTE: while testing, you might note that there are different results for the same text between post and page in default editor. This is reproducible on
trunk. And this IM issue was created for itThis testing plan is quite extensive. The reason is that this PR touches A lot of different marking
WordPress
catnip.txt
NOTE: Add the text in
Texteditor mode in Classic editor, and in Code editor mode in Block editorKeyword density assessment
hrefvalue doesn't contain yoast mark tags, e.g."<yoastmark class='yoast-text-mark'>"or"</yoastmark>"hrefvalue doesn't contain yoast mark tags, e.g."<yoastmark class='yoast-text-mark'>"or"</yoastmark>"Keyphrase distribution assessment
composer require yoast/wordpress-seo:dev-19477-attempt-3-yoast-markers-break-html-of-content-in-shopify-and-classic@devbefore building ithrefvalue doesn't contain yoast mark tags, e.g."<yoastmark class='yoast-text-mark'>"or"</yoastmark>"hrefvalue doesn't contain yoast mark tags, e.g."<yoastmark class='yoast-text-mark'>"or"</yoastmark>"Synonyms:
catmintas a keyphrase synonym.catnipare markedcatnipas well as all occurrences ofcatmintare markedcatmintcatmintare properly highlighted.catmintare still there. (there should be 3 occurrences)Word complexity assessment
hrefvalue doesn't contain yoast mark tags, e.g."<yoastmark class='yoast-text-mark'>"or"</yoastmark>"Sentence length, Passive voice, and Transition words assessment
However, the compounds were found to repel <a href="https://en.wikipedia.org/wiki/Mosquito" rel="nofollow">mosquitos</a>, and it is hypothesized that rubbing against the plants provides the cats with a chemical coat that protects them against mosquito bites.NOTE: Add the text in
Texteditor mode in Classic editor, and in Code editor mode in Block editorConsecutive sentences assessment
<a href="https://en.wikipedia.org/wiki/Cat">Cats</a> detect nepetalactone through their <a href="https://en.wikipedia.org/wiki/Olfactory_epithelium">olfactory epithelium</a>, not through their vomeronasal organ. <a href="https://en.wikipedia.org/wiki/Cat">Cats</a> detect nepetalactone through their <a href="https://en.wikipedia.org/wiki/Olfactory_epithelium">olfactory epithelium</a>, not through their vomeronasal organ. <a href="https://en.wikipedia.org/wiki/Cat">Cats</a> detect nepetalactone through their <a href="https://en.wikipedia.org/wiki/Olfactory_epithelium">olfactory epithelium</a>, not through their vomeronasal organ.NOTE: Add the text in
Texteditor mode in Classic editor, and in Code editor mode in Block editorParagraph length assessment
Paragraph length assessment
Inclusive language analysis
Upgrade routine
Install and activate the previous version of Yoast SEO
Set the site language to English
Create a post in Classic editor and add this text:
catnip.txt
NOTE: Add the text in
Texteditor mode in Classic editorSet "catnip" as the focus keyphrase
Embed this link below to the phrase "catnip flowers":
Smoke test Advanced custom fields
Smoke classic editor block in block editor
/classicblock (create a new block and type/classic), and add some text to it that contains the wordscatnipandcatmint.catnipandcatmintare highlighted.catnipare highlighted.Test in Shopify
Install and activate Yoast SEO for Shopify
maininshopify-seowordpress-seobefore buildingSet the store language to English
Create a product and add this text:
catnip.txt
NOTE: the test instruction below should be repeated in all content types in Shopify
Keyword density and Keyphrase distribution assessment
hrefvalue doesn't contain yoast mark tags, e.g."<yoastmark class='yoast-text-mark'>"or"</yoastmark>"hrefvalue doesn't contain yoast mark tags, e.g."<yoastmark class='yoast-text-mark'>"or"</yoastmark>"Confirm that the keyword density assessment still detects 8 occurrences of the keyphrase in the text
Click the eye icon of keyword density assessment
Confirm that the "catnip" in "catnip flower" is highlighted
Check the anchor link of the phrase and confirm that the
hrefvalue doesn't contain yoast mark tags, e.g."<yoastmark class='yoast-text-mark'>"or"</yoastmark>"Click the eye icon of keyphrase distribution assessment
Confirm that the "catnip" in "catnip flowers" is highlighted
Check the anchor link of the phrase and confirm that the
hrefvalue doesn't contain yoast mark tags, e.g."<yoastmark class='yoast-text-mark'>"or"</yoastmark>"Word complexity assessment
hrefvalue doesn't contain yoast mark tags, e.g."<yoastmark class='yoast-text-mark'>"or"</yoastmark>"(Smoke) Test impact by sentence tokenizer
<i>The cat</i> was greeted by <i>the dog</i>.<div>The cat was greeted by the dog</div>.midgetto a few random sentences in the post. This should trigger the inclusive language assessment formidget.midget.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 and noted the work hours.Fixes #19477