carlcs / craft-redactorcustomstyles

Redactor Custom Styles plugin for Craft CMS
MIT License
61 stars 13 forks source link

"clear": true not working #13

Closed mark-chief closed 7 years ago

mark-chief commented 7 years ago

Doesn't seem to have any effect when trying to remove formatting. Craft v2.6.2978

Tried on paragraph text like <p class="align-left">asdasd</p>


{

  "buttonsAdd": {
    "style": {
      "title": "Style",
      "dropdown": {
        "align-left": {
          "title": "Align left",
          "args": ["p","class","align-left"]
        },
        "align-right": {
          "title": "Align right",
          "args": ["p","class","align-right"]
        },
        "remove": {
          "title": "Remove all styles",
          "clear": true
        },        
        "align-center": {
          "title": "Align center",
          "args": ["p","class","align-center"]
        }
      }
    }
  }

}
carlcs commented 7 years ago

This is the expected behavior because "clear": true only removes the inline formatting. What I would suggest to remove the alignment class is to setup “Align left” like so:

"align-left": {
  "title": "Align left",
  "args": ["p"]
},