I installed FCK Editor and Drutex modules on my Drupal web site. I found that when I insert a latex formula where the symbol ">" or "<" appears, the FCK Editor replace those symbols with "&gt;" and "&lt;", respectively. This change produces a nasty latex formula.

Same problem occurs when i use too much spaces or when i use any other html symbol like "&" on the formula.

I would like that FCK Editor keep his hand out of the latex region, but it seems complicated. I think, an easier solution would be to modify DruTeX module. Drutex just have to correct this error by reconstructing the original string using something like html_entity_decode().

I modify the module my self adding the line $text = html_entity_decode($text); on the next context:

function drutex_render($text, $format = -1, $attributes = '', $default_attributes = '') {
  $text = _drutex_unescape($text);
 +$text = html_entity_decode($text);
  if (drutex_submodule_is_active('security', $format)) {

But i don't know if this change could cause too much trouble. But at the moment, i got no more nasty rendered formulas.

Comments

ShaunDychko’s picture

Hi There, add:

FCKConfig.ProtectedSource.Add( /<tex[\s\S]*?\/tex>/g );

to the file modules/fckeditor/fckeditor.config.js and enter your equations in Source mode between <tex> and </tex> tags. (note that the equations won't be visible back in WYSIWYG mode, which is by design since it means FCKEditor is keeping it's hands off).

jrviorato’s picture

jrviorato’s picture

I try that one checkmark, but I hate to be constantly switching from WYSIWYG to Source mode. My web site uses a lot of Math formulas and not seeing them on WYSIWYG mode makes WYSIWYG useless.

ShaunDychko’s picture

Jhun Vert’s picture

Try to rearrange the filter of your input formats so that Drutex will come first before HTML corrector. I encountered this problem before and the rearrangement solved my trouble.