Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Create a new block, add html
<div class="teaser-btn">
<a class="teaser-buy" href="#"></a>
<a class="teaser-readmore" href="#"></a>
</div>
Switch to WYSIWYG HTML editor and back to code and see this
<div class="teaser-btn"> </div>
I'm added config.allowedContent = true;
in settings but problem remains.
Why works filter on Full HTML format?
Comments
Comment #1
jcisio CreditAttribution: jcisio commentedI think it is the default library behavior to remove "empty" element. Check it at http://ckeditor.com/demo
Comment #2
Photoshopper CreditAttribution: Photoshopper commentedhttp://ckeditor.com/demo remove too.
I would like to turn this off.
Comment #3
wwwpro CreditAttribution: wwwpro commentedI haven't found how to turn it off, but I have found that adding
will prevent the tags from being removed.So, your code would look like this...
Comment #4
Photoshopper CreditAttribution: Photoshopper commentedThanks, I'm knew it
Comment #5
euskarez CreditAttribution: euskarez commentedI've the same problem with input tag and I can't insert because input tags haven't open and close tag.
someone can help me?
thanks!
Comment #6
rajesh.vishwakarma CreditAttribution: rajesh.vishwakarma commentedCKEditor remove this for empty html tags. So Create a new format for this.
Go to admin/config/content/formats/add and add new format.
Note: Don't enable any checkbox in Enabled filters section. You can enable PHP evaluator if necessary.
Comment #7
TaraRowell CreditAttribution: TaraRowell commentedAdd this setting under the Advanced tab and in the Custom Javascript configuration on the Full HTML format at admin/config/content/ckeditor/edit/Full:
config.allowedContent = true;
Comment #8
kruser CreditAttribution: kruser commentedI would also add...
config.extraAllowedContent = '*(*)';
Comment #9
MediaFormat CreditAttribution: MediaFormat commented+1
Comment #10
knalstaaf CreditAttribution: knalstaaf commentedNone of the above is working. This should at least be configurable.
This behaviour is making the use of empty anchors unworkable. This is also frustrating for people using features like Font Awesome and Bootstrap Glyphs (using spaces makes icons look bloated).
Comment #11
kenorb CreditAttribution: kenorb commented