Tinymce madness

Tinymce madness

by Nigel McNie -
Number of replies: 3
Hi people,

I'm trying to use the tinymce editor as part of a project I'm working on, but it appears that tinymce converts things like apostrophes to '. This is causing problems for me because they're inserted into the database that way (html2text doesn't seem to catch it) and then when forum posts are emailed in plain text form the ' appears in the mail.

Has anyone encountered this problem before, or know of a fix?
Average of ratings: -
In reply to Nigel McNie

Re: Tinymce madness

by David Scotson -

html2text is supposed to catch these things so it's more likely a problem with that rather than TinyMCE. It would be interesting to test if catches &#039 i.e. effectively identical but textually different from &#39 because (I think) that's what PHP generates going the other way.

In reply to David Scotson

Re: Tinymce madness

by Nigel McNie -
PHP generates different things depending on phase of the moon as far as I can tell... see the docs for get_html_translation_table(). In any event, html2text does NOT convert these, or indeed any of the other ones that are possible (such as for "curly quotes" or emdash).

I'm going to try to configure tinymce to not do any conversions, and failing that I might have to convert the entities to their actual unicode characters before inserting into the database.
In reply to David Scotson

Re: Tinymce madness

by Nigel McNie -
I found a solution to this problem. Tinymce maintains a list of characters it will convert, and you can override it:

entities : "60,lt,62,gt,38,amp,34,quot"

Doing that means only those entities are changed, and the other characters are stored in their unicode forms.