Copied to clipboard

Flag this post as spam?

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


  • Jeremy Schlosser 15 posts 146 karma points
    May 31, 2023 @ 18:50
    Jeremy Schlosser
    0

    RTE/TinyMCE insists on remove <br> tags

    I have added the
    element to appsettings.json ValidElements and also CustomConfig valid_children list, but nothing appears to stop the editor from removing the element. Please can someone advise? Here is the appsettings.json entry:

    "Umbraco": {
    "CMS": {
      "RichTextEditor": {
        "ValidElements": "+a[id|rel|data-id|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class],-em/-i[class],-strike[class],-p[id|dir|class],-ol[class|reversed|start|type],-ul[class],-li[class|start],br [class],-mark[class|id],img[id|dir|lang|longdesc|usemap|class|src|onmouseover|onmouseout|border|alt=|title|width|height|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel|data-id|loading],-form[name|action|class|id|method],select [name|size|onchange],option [value|selected],-input[type|value|name|class|id|checked|onclick|placeholder],label[class|for],audio[controls],source[src|type],-sub[class],-sup[class],-blockquote[dir|class],-table[border=0|cellspacing|cellpadding|width|height|class|summary|dir|id|lang|bgcolor|background|bordercolor],-noscript,summary,-abbr[class|title],-dfn[id|class|title],-article[id|class],-section[id|class],-aside[id|class],-nav[id|class],-tr[id|lang|dir|class|rowspan|width|height|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|scope],caption[id|lang|dir|class],-div[id|dir|class],-span[class],-pre[class],address[class],-h1[id|dir|class],-h2[id|dir|class],-h3[id|dir|class],-h4[id|dir|class],-h5[id|dir|class],-h6[id|dir|class],hr[class],dd[id|class|title|dir|lang],dl[id|class|title|dir|lang],dt[id|class|title|dir|lang],object[class|id|width|height|codebase|*],area[shape|coords|alt|href|onclick|id|class],canvas[*],param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class|id],area[shape|coords|href|alt|target|class],bdo[class],button[class|onclick|id|name],iframe[*]",
        "InvalidElements": "font",
        "CustomConfig": {
          "valid_children": "+a[div|p|img|br],-span[br],-ul[br],-li[br]"
        }
      },
    
  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Jun 01, 2023 @ 12:28
    Huw Reddick
    100

    Your problem is a space br [class] should be br[class] in ValidElements

  • Jeremy Schlosser 15 posts 146 karma points
    Jun 01, 2023 @ 16:51
    Jeremy Schlosser
    0

    Thank you, Huw. Good catch.

Please Sign in or register to post replies

Write your reply to:

Draft