Currently, AddLinkArticleTarget.prototype.annotateSuggestions can only locate phrases to turn into link recommendations that fall entirely within the same text node. If the phrase contains an annotation (e.g. we're looking for German cuisine but the HTML is <i>German</i> cuisine) or contains an entity that Parsoid wraps in a span (e.g. we're looking for cafés, but the HTML is caf<span typeof="mw:Entity" id="...">é</span>s), then the phrase does not fall entirely within one text node and we will fail to find it.
|Resolved||Catrope||T261398 Add a link engineering: Prototype the recommended link plugin in VisualEditor using phrase matching approach|
|Open||None||T267695 Add a link in VE: handle span-wrapped entities and annotations when finding link recommendation phrases|
I'm moving this into the post-release backlog, I would first like to see data from T278487: Instrumentation: Number of phrases not found in document before we decide to go down this path.