To reproduce, you create a glossary word (this happened to me because I was using the word "gloss" as a glossary word). For the input filter in question, you select to highlight/show the word "only the first match." The match type should be set to "Word."

Create a test page using your input filter.

On the test page, put a word that starts the same, later followed by the actual word you want to match. For example, your glossary word is "gloss," and text might be:

One of the words in my glossary is gloss.

The code matches "gloss" INSIDE of the word "glossary," but since the character following it is "a" (not a "boundary" character according to _glossary_is_boundary) it is not a $proper_match (near line 700 of glossary.module).

It seems really then, that the event-building that happens above is not truly matching by "whole word" even tho "word" is selected as the type. I'm not sure if the solution then is to not count that as a true match so keep trying, or to make sure the initial match is followed by a boundary character, or some other solution.

Note that if your test text is something like "Gloss is one of the words in my glossary" then it works fine, because the correct match appears first.

This is not a special case for "gloss" and "glossary," (just happens to be what I used). I tested with "someword" and "somewordtest" all the same.

CommentFileSizeAuthor
#1 glossary.module.patch4.2 KBsdrycroft
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sdrycroft’s picture

FileSize
4.2 KB

The enclosed patch fixes this issue. You may have to apply the patch from #818218: Patch to greatly improve performance before applying this though.

Cheers, Simon

sdrycroft’s picture

Status: Active » Needs review
NancyDru’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)