I was doing some testing with the module and ran across a problem related to the regex pattern in the _glossify_to_links function.

The \s+ whitespace match was matching across newlines in my example text which threw an error on line 298 when it came time to create the link, and also prevented it from matching the proper term which followed. replaced it with [^\S\r\n]+ which matches whitespace but not \n or \r and that took care of my problem. I made that change in lines, 261, 262 and 286.

Comments

WorldFallz’s picture

Issue summary: View changes
Status: Active » Reviewed & tested by the community

Awesome catch... thanks for posting it. I hope to go through the issue queue this weekend and get an updated release out.

batje’s picture

Status: Reviewed & tested by the community » Needs work

this issue needs a patch (or a commit) before it can be tested.

WorldFallz’s picture

Status: Needs work » Active

I'm not sure that this behavior is actually correct. If there is some term with multiple words like "rutrum tempus mattis" and simply by virtue of auto line break it gets split like:

Integer consectetur sagittis dolor! Nullam est elit, non, rutrum tempus
mattis. Pellentesque lobortis nisi at fringilla scelerisque. Sed porta sit 
amet odio sodales dignissim.

It won't match but I would think for the majority of use cases it should match, no?

WorldFallz’s picture

Status: Active » Postponed (maintainer needs more info)

I'm also unable to reproduce the error message-- it would help a great deal if you included the exact text of the message and what glossify settings you're using as well as any input filters on the text format in question.