Hello.
The function "glossify_nodeapi" contains the variable:

$pattern = '/\b(?<!\"|\/)' . $term . '\b/';

for matching. I changed this to

$pattern = '/\b(?<!\"|\/)' . $term . '\b/i';

to make it case insensitive. However, one of my node titles is "HTML", and when I made the regular expression case insensitive all **** broke loose, because my file extension is also "html"

This creates an output where one link is nested within the other, like this:

<a class="glossify_term" html.html="" directory_where_the_html_document_is_placed_virtually="" href="node-url.<a href=">HTML</a>
" class="glossify_term">node title

Comments

jponch’s picture

Not sure if this is the same problem or not, but I think there needs to be a UI setting for whether glossify should search in a case sensitive manner or not. On my site, I've found that if the word begins the sentence or happens to be capitalized in my content then it will not be glossified if the glossary term is not capitalized (and vise versa). Is there a work around for this?

talatnat’s picture

There should a be a note about case-sensitivity in at least the Readme.txt. I spent a good bit of time troubleshooting my setup until I tried case-sensitive matches and got the module working, and then ran across this thread. I am doing the Links style, and it just does not look correct to have the Title in lower case to make this module work because most of all the content to be linked happens to be in lower case.

Glossary (the other module) has a UI setting for setting case sensitivity.

rsvelko’s picture

Title: Case sensitive problem » Add case sensitivity setting
Category: bug » feature
Priority: Normal » Critical

We have:
1. Case sensitivity setting feature request - a new checkbox
2. A bug because glossify 1.x replaced even into html-tags - where it shouln't

With v.2.0 , released this night 2. is being fixed, so I make this a feature request.

Anonymous’s picture

Version: 6.x-1.1 » 6.x-2.0-alpha1

I would simply like to second the request for case-sensitivity options. It would also be helpful to have some transliteration functionality as well—there is a transliteration module. You can't expect users to always use the appropriate accent marks :)

Transliteration may somehow be linked with synonym functionality as well. Say, if the term has some automatically generated synonyms. This could cause some duplicate uses though, e.g. basé would transliterate into base, so I'm sure this would need to be a UI option.

shunshifu’s picture

subscribing.
This is an awesome concept. But really needs case insensitivity to be useful.
Can't wait

Thank you

Ivo.Radulovski’s picture

interesting

rsvelko’s picture

Status: Active » Needs work
Issue tags: +2.0

this is simple enough to enter before 2.0 stable is ready...

rsvelko’s picture

Priority: Critical » Normal

--------------------
"This creates an output where one link is nested within the other" - this was fixed in 2.0-rc2.

---------------------

case sensitivity will be in - when rc3 comes (actually rc-s are not meant for new features, but this one is very small )

Tong’s picture

it seems in latest release no checkbox: Case sensitve ?

where i can change manually function "glossify_nodeapi" in drupal ?

Cheers, Tong

okokokok’s picture

I added a little i to __glossify_convert_string_array_to_array_of_escaped_regexps()

foreach ($needles as $needle) {
      // this below is Unicode compatible                                                                                                   
      $regexps[] = "/(?<!\p{L})" . preg_quote($needle, "/") . "(?!\p{L})/ui";
    }

Like this lower case terms are also glossified, but they're also turned into Uppercase. So it needs more work than the little i.

artatac’s picture

sub

WorldFallz’s picture

Status: Needs work » Closed (fixed)

unsupported version, and the 6.x-3.x version has a case sensitivity setting