The TinyMCE module's "convert fonts to styles" setting doesn't work because in TinyMCE (from Moxiecode) the config parameter is actually convert_fonts_to_spans (see TinyMCE's documentation). In the TinyMCE module's code this appears erroneously as convert_fonts_to_styles). Simply renaming the parameter where it occurs in the module seems to solve the problem.

I've attached a patch for review. Special thanks to ejhildreth for assistance tracking down this issue.

I believe other versions of the module contain this issue as well, but haven't had a chance to check.

mlsamuelson

CommentFileSizeAuthor
tinymce.module_fonts_to_spans.patch1.92 KBmlsamuelson

Comments

m1mic’s picture

subscribing

kreynen’s picture

Assigned: Unassigned » kreynen

Thanks. I need to look into this more closely, but at first glance I think you are right. If so, I'll role this into the next update.

mlsamuelson’s picture

Great, kreynan.

I should probably have noted I tested with Tinymce 2.1.0.

Also, this appears like it could be a related issue (not in a bug way, but an issue way): http://drupal.org/node/84797 .

mlsamuelson

m1mic’s picture

The same technique that was used in the patch works on Drupal 4.7.6, TinyMCE 4.7, with Moxie Code's TinyMCE 2.0.6. Changed out convert_fonts_to_styles with convert_fonts_to_spans in the .module file

badbuta’s picture

I have applied the patch. It works!

However, when I submit the content and reopen it. TinyMCE does not show me the text color what I did before. If I read the HTML code using "Disable/Enable Rich-text", the tag is placed exactly there. The page view does not have any problem for the tag style. This problem only appears in the TinyMCE editor area. In addition, it also happens when I toggle the Rich-text before submit.

On the other hand, according to other thread/post, I have tried to add another setting like "Cleanup: true/false" within tinyMCE.init block. But.... it does not fix the problem.

Is it a Module bug or TinyMCE's bug?

mlsamuelson’s picture

Perhaps an issue with using the HTML input filter? If you change your input format to Full HTML (if you aren't already) does the styling come through?

I need to look into it futher, but I believe the HTML filter strips out the style attribute in span tags.

mlsamuelson

eaton’s picture

Subscribing to this issue -- I've run into the same problem. I'll test this when I get a chance.

badbuta’s picture

I have tried Full HTML filter. The problem is still there.
I also verify the generated source code. The tag is there.

Just want to clarify that the style (color) does not show up ONLY in the WYSIWYG editor. Node page display is normal.

m1mic’s picture

@badbuta -- This is not an issue with the TinyMCE module itself. Rather, it is a known bug with Moxie Code's TinyMCE javascript (the code you put in the tinymce/tinymce folder). If you go look at their issue queue on SourceForge, you can find a couple of references to this. For example, see http://sourceforge.net/tracker/index.php?func=detail&aid=1678361&group_i... or http://sourceforge.net/tracker/index.php?func=detail&aid=1677164&group_i... as two examples.

badbuta’s picture

I see.
So, I can only wait for the TinyMCE bugfix.... :-<

m3avrck’s picture

Status: Needs review » Fixed

Thanks fixed!

mlsamuelson’s picture

Sweet. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)
udig’s picture

I spent days on the annoying behavior described by badbuta... before I was able to resolve / workaround it.

goto TinyMCE profile -> 'cleanup and output'. change 'Convert tags to styles' from True to False. This will allow you to see the changes you've made to the text using the text color when re-editing.

Note that I merely used trial and error method here so I can not really tell if this is a 'correct' solution. Generally speaking allowing the use of font tags is not recommended - see http://www.webreference.com/html/tutorial22/

Anyhow I hope this gives whomever need some direction...

cozzi’s picture

This has become a huge time sink for me.

Selecting "Filtered HTML" inhibits the use of inline text colors and I can't figure out why? I've made sure that all tags being used in the post are allowable tags by my HTML filter. Yet, when I switch to Full HTML the inline text color shows.

I'm running 5.x with Drupal's WYSIWYG module with TinyMCE. I honestly don't see how this is a TinyMCE issue noted above since a switch to FULL HTML solves the problem - but I clearly I can't give my users "Full HTML". Note: I do understand that TinyMCE should probably be converting to styles verses span but span works with Full HTML, why?

I've tried the note from post #14 but it did not work for me.

thank you
Cozmo

Sorry - I realize now that this post should really have been put in the wysiwyg api area. (I would have deleted it but I don't see how I can.)