5

I want to strip the "class attribute" from a tag. What's the best way?

Example:

 <div id="portlets-footer" class="row"> ... </div>

Thank's Vito

Vito
  • 1,201
  • 1
  • 10
  • 16

1 Answers1

8

according to the drop's section of the docs [1] you can use "drop" + "attributes":

"If you want to drop attributes instead of whole tags, you can use the attributes attribute to provide a space-separated list of attributes that should be dropped on the matched theme node(s). For example, with attributes="class" the class attribute will be dropped from the matched node(s). Using attributes="class id", the class and id attributes will both be dropped."

[1] http://diazo.org/basic.html

simahawk
  • 2,421
  • 1
  • 16
  • 22
  • Too bad that "You should not use theme-children or content-children or their CSS equivalents when using attributes." I wanted to use this to strip the style attribute from all content created in TinyMCE, since the editor likes to sprinkle random "style={height: 1.5px;}" everywhere. – fulv Apr 23 '15 at 19:59