Copied to clipboard

Flag this post as spam?

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


  • Martin Griffiths 781 posts 1178 karma points c-trib
    Jul 01, 2019 @ 13:01
    Martin Griffiths
    0

    Bizarre behaviour in attributes in tinyMCE

    I have been suffering a rather odd behaviour in the tinyMCE that I wonder if anyone else has come across.

    I'd recently honed our validElement list in the tinyMCE.config to stop the style attribute from being pasted or manually added from editor copy. We have a few classnames we allow, but generally inline style isn't allowed.

    I thought it was working fine when I noticed Lists and List Items were retaining the inline styles despite them not being allowed in the config file.

     <![CDATA[+a[id|name|href|target|title|class],-strong/-b[class],-em/-i[class],-p[id|class],-ol[class],-ul[class],-li[class],br,img[id|class|src|alt|title|width|height|data-udi],-sub,-sup,-table[border=0|cellspacing=0|cellpadding=0|class|id],-tr[id|class|rowspan|align|valign|width|height],tbody[id|class],thead[id|class],tfoot[id|class],#td[id|class|colspan|rowspan|width|height|align|valign],-th[id|class|colspan|rowspan|width|height|align|valign],-span[class|align],-h1[id|class],-h2[id|class],-h3[id|class],-h4[id|class],-h5[id|class],-h6[id|class],hr[class],iframe[*]]]>
    

    code editor

    <ul style="background-color: transparent; color: #000000; cursor: text; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">
    

    It continues to strip on any other element just fine....its all very odd.

    Any ideas, anyone? I'm using Umbraco 7.14.

    Martin

Please Sign in or register to post replies

Write your reply to:

Draft