Crossing out some text in a text field using tinyMCE shows the effect as expected. When in edit mode I can see that CSS tags like "text-decoration: line-through" are used. After saving these CSS tags are no more in the output.
What has to be done to avoid filtering out these CSS tags?

Comments

pobster’s picture

Change the input format to 'Full HTML'? As part of the clean up perhaps tinyMCE changes from css tags to <strike> tags and perhaps your 'Filtered HTML' setting is stripping them? This is only a big perhaps... But worth trying anyway?

Pobster

schildi’s picture

While in edit mode I can see that the text is lined through. And using the browsers function to inspect the page source I see the CSS code embracing the text (in span ...). So it looks that still CSS is used.
But I will check your hint!

regards

schildi’s picture

OK, I just inspected the database. In table node_revisons I can see that body contains

    <span style="text-decoration: line-through;">Es ist eine ...

I also put <strike> in the list of allowed tags with no avail.

pobster’s picture

Ahhhhh so it's not actually stripping anything, your problem is likely that your theme is over-riding the style tag. I assume if you view the source you can see the same <span style...? Have you added <span> to your input filter or tried using Full HTML?

As for a fix if it is something over-riding the style... Well... It'd be dependent on your site set up, too much guesswork I'm afraid... You'd need to post up some more information so we can pinpoint the problem.

Pobster

schildi’s picture

Now I also tried the "Full HTML" input format. No change, but (sorry for my stupidity) appending "span" to the list of allowed tags yields in <span>Es ist eine ....
So, it looks that somebody is steeling the CSS classes from the output.

Can it has to do with the template defined for "story"? I use the module contemplate (content template) to allow stories have images appended:

<?php print $node->content['body']['#value'] ?>
<div class="field field-type-image field-field-attach-image">
  <div class="field-items">
    <?php foreach ((array)$node->field_attach_image as $item) { ?>
      <div class="field-item"><a href="/<?php $item['filepath'] ?>" ><?php print $item['view']; ?></a></div>
    <?php } ?>
  </div>
</div>

I can answer myself. After deactivating the template (reset) nothing changed.
What can I do else to fix it?

pobster’s picture

Just out of curiosity... Try disabling TinyMCE and entering a <span style... tag - see if Drupal strips it.

...Wait... Did you say the the database shows the 'style' part - it's only when it's passed from the db to the screen that it vanishes?

Pobster

schildi’s picture

Yes, the content stored in the database is correct. But some process is purging these CSS classes.

dman’s picture

It's the view-source you should have been looking at, not the database.

The process that is purging styles is the HTML filter. You should NOT have HTML filter active on 'Full HTML' format, and you MUST have full HTML format chosen to use all the buttons in a WYSIWYG effectively.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

acosta.edgar’s picture

I have the same problem here, I am not using tinyMCE, but I am using the texy! filter. When I see the resulting code I only see the tag without the css code.

Edgar Acosta