Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jul 06, 2009 @ 04:52
    Aaron Powell
    0

    TinyMCE - setting HTML tag + css class

    The custom styles drop down in TinyMCE seems to be able to insert either a tag (say, <pre />) or a css class (say .code) but can I get a single selection item that does both at once?

    I tried having the alias of the style pre .code but it only added the <pre /> tag.

    Can both be done?

  • Shannon Deminick 1530 posts 5278 karma points MVP 4x
    Jul 06, 2009 @ 06:19
    Shannon Deminick
    0

    The tinyMCE config will need to be edited to allow for the class attribute to be applied to 'pre'

    i.e:

    pre[class]

    On this same note of TinyMCE and pre tags, it seems to always strip out white space from pre tags which is bad since that is what pre is for. I've found with other TinyMCE installs, that you need to set: apply_source_formatting = false so it doesn't strip out the white space. This obviously means that it won't cleanup the html code though :(

    I've tried the preelementfix plugin but that doesn't seem to fix this problem either.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies