special characters converted in html entities
| Project: | Glossary |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Hello,
The glossary links are not added in the node page on words that have special characters, if these special characters are converted into html entities like they should, for example with a WYSIWYG editor like FCKeditor.
Example :
- in the vocabulary "Glossaire" I have a term "atmosphère"
- in a node body I enter somewhere "atmosph&eagrave;re" (plain text editor) or "atmosphère" in a WYSIWYG editor and the editor converts it into "atmosph&eagrave;re"
- the glossary link is not added on "atmosphère" when viewing the page, because in fact in the source code it is "atmosph&eagrave;re" and the glossary filter is looking for "atmosphère".
I tried to create the html entities converted term instead of the plain term with special characters, but it's not nice since in the glossary page, the output is the html entities code (example : the output in the glossary page is "atmosph&eagrave;re" and not "atmosphère".
Another solution would be to disable the html entities conversion of special characters in the WYSIWYG editor. It's possible with FCKeditor, but it's not very standards friendly.
I think the best solution would be if the glossary filter could look, for each term, for the real term (special characters) and for the html-entitified term. Do you agree with that ?

#1
Here's a patch that does the job with extra code inside _glossary_get_synonyms.
If no WYSIWYG editor is installed (from the list fckeditor, tinymce, htmlbox, jwysiwyg, yui_editor, to be continued), then _glossary_get_synonyms does its job as usual.
If there is one, we're assuming the textarea will convert special characters to htmlentities, and that we need to have some kind of virtual synonyms :
école -> virtual synonym of écoleThe query has to be splitted into two recursive queries :
1) Fetch the terms of the vid and look if they have special characters. If yes, add the htmlentities version as a synonym.
2) Check if the term has any (real) synonyms. If yes, add the synonym. Then if the synonym has special characters, add the htmlentities version as well
It's my first patch that adds a feature in Drupal, I hope it's not too ugly. Maybe the feature should be chosen as an option in the glossary settings, but I believe that the automatic triggering if any WYSIWYG editor is installed is better.
#2
Hello,
What about that patch ? Would you be willing to integrate it if I update the patch to the latest dev ?
For now, Glossary is useless with a lot of languages and WYSIWYG editors.
See you
Guix
#3
Thank you very mutch for this patch !!!
I'm french, I just created a new website, and I had the problem with the htmlentities conversion that were not understood by Glossary...
I just added the 'wysiwyg' module in the ' if condition ' of your patch ; and it rocks !
Thanks again ;)
#4
Thanks ! I'll add wysiwyg to a new patch against -dev if I get a positive review by Moshe.
#5
Bump, Nancydru would you like me to roll a new patch ?
#6
guix - please, that would be really helpful thanks!
i am using the current stable version, with a few modifications to get multi-language working properly. but am having much troubles with special characters in the other languages in the synonyms.
thanks!!
#7
I don't know which source to patch against, HEAD is still 5.x. DRUPAL-6--1 ?