Open dariaknl opened 5 years ago
Interesting fact: the spurious highlights only occur when there is a heading apple
. If I remove the heading or I make it apple bla bla
or Apple
, only correct instances of the keyphrase are highlighted.
The current mechanism of highlighting keyphrases is as follows.
apple
.[
"Maecenas <yoastmark class='yoast-text-mark'>apple</yoastmark> a auctor mi.",
"<yoastmark class='yoast-text-mark'>apple</yoastmark>",
"Maecenas <yoastmark class='yoast-text-mark'>apple</yoastmark> a auctor mi."
]
"ametapple"
is considered to include the sentence
"<yoastmark class='yoast-text-mark'>apple</yoastmark>"
.The problem occurs if the following two conditions are fulfilled:
It's hard to believe that this happens with a regular text. However, if the keyphrase includes somewhat shorter (non-function) words and if one / some of these words are used alone in a sentence (for instance, in a heading), there is a risk of a problem demonstrated by the issue.
We at Team Lingo believe it's an edge case, which is unlikely to bother a lot of users and which can wait for the new Tree Parser to solve it. @moorscode do you agree?
Tested with WP 5.0.3 and 10.1 beta2.
How can we reproduce this behavior?
Fill in keyword "apple".
Check assessment:
Toggle eye marker:
It is expected to see only word "apple" being highlighted 3 times.