What HTML attributes are allowed on a Tumblr post? (tinymce)

前端 未结 3 547
温柔的废话
温柔的废话 2021-01-06 10:15

When creating a Tumblr post, and using the HTML editor option, when I add specific HTML attributes to elements, the TinyMCE rich text editor strips nearly everything off.

3条回答
  •  不要未来只要你来
    2021-01-06 11:04

    1) Stripping elements can be turned off using the following tinymce init parameter cleanup:false,

    2) The default definition of valid html elmements can be found here: http://www.tinymce.com/wiki.php/Configuration:valid_elements

    In order to keep data-random as an attribute of span you will need to set the valid_children init parameter as follows

    valid_children: "body[p|ol|ul|hr]" +
    ",span[a|b|i|u|sup|sub|img|data-random|#text]" +
    ",a[span|b|i|u|sup|sub|img|#text]", //...
    

提交回复
热议问题