Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

tinymce

tumblr

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.

i.e. this:

<span class="something" data-random="foobar">

becomes this:

<span class="something">

and this is unaffected:

<span class="something" title="foobar">

So can I either 1) disable this scrubbing (which is ridiculous, at least how it's currently implemented) or 2) get a list of all valid attributes so I can choose the best semantic choice?

like image 406
Nathan Loyer Avatar asked Dec 28 '22 10:12

Nathan Loyer


1 Answers

This was killing me too. And searching google for any tumblr dev help more complicated than "how do I edit text color", oy vey. I wouldn't wish it on anyone.

Tumblr users don't have any control of the html or js that runs the control panel, and so can't add any files that alter TinyMCE configuration. But you can just turn it off. In the Dashboard tab of your Tumblr settings, you'll find a Text Editor section. Selecting plain html or Markdown will deactivate TinyMCE and allow you to post forms, data attributes, and any non-whitelist html to your heart's content.

like image 50
RobW Avatar answered May 16 '23 07:05

RobW