Copied to clipboard

Flag this post as spam?

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


  • Bendik Engebretsen 105 posts 202 karma points
    Oct 14, 2016 @ 14:13
    Bendik Engebretsen
    0

    tinyMCE HTML tidying

    I'm pulling my hair out trying to get the RTE in Umbraco 7 to accept HTML b tags when pasting HTML in the "Source code" window. As soon as I click OK, tinyMCE strips them away. Pasting HTML with strong tags however works fine. I've tried fiddling With the tinyMceConfig.config and the validElements tag, without any luck.

    Does anyone else have the same problem and knows how to get around it?

  • Marc Goodson 2157 posts 14434 karma points MVP 9x c-trib
    Oct 15, 2016 @ 11:51
    Marc Goodson
    102

    Hi Bendik

    The world of tinymce validElements is very strange...

    By default with Umbraco for the b tag you have an entry that says:

    -strong/-b[class|style]
    

    the slash here means, whenever there is a b tag, replace it with a strong tag, ie b tags aren't allowed!

    so to enable b tags, you need to remove this and have a seperate entry for b tags, eg:

    -strong[class|style],-b[class|style],
    

    This enables both string and b tags to be entered into tinymce

    Two other gotchas though...

    with the - in front of the b tinymce will strip empty tags eg

    if you need to allow empty b tags you need to replace the - with a #

    eg

     -strong[class|style],#b[class|style],
    

    and final gotcha, which gets me everytime, is you need to do an app pool recycle, after each change to the configuration to see the results of the change in Umbraco!!

    hope that helps with your b tags!

    regards

    Marc

  • Bendik Engebretsen 105 posts 202 karma points
    Oct 17, 2016 @ 12:23
    Bendik Engebretsen
    0

    Thanks Marc!

    I finally got it to work! Indeed a very strange world...

  • 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