javascript
javascript copied to clipboard
Not all characters are properly matched if used as a keyword
What did you expect to happen?
When adding special characters as my keyword, such as <,> etc., I expect them to be matched in the Snippet Editor.
Oddly enough this does work with €.
What happened instead?
The keyword is not being emphasised in the Snippet Preview.
How can we reproduce this behavior?
Make a new post and add a title and some content containing a > or < character.
Set your keyword to something such as >.
Check the Snippet Preview's output.
Technical info
- WordPress version: 4.5.2
- Yoast SEO version: Latest trunk (or 3.3 beta 3 release)
This issue still exists (at least partially) in Yoast SEO 4.9. Compare:

These characters should be displayed because Google shows them too.
In Yoast 9.7 I can still confirm this issue. Single characters such as < or ^ seem to create a loop for the keyword analyzer (the spinning wheel shows and nothing happens). Using the € character yields no troubles though.
@moorscode mind moving this to the YoastSEO.js repo?
+1 for https://wordpress.org/support/topic/interpunction-in-keywords/