WillKP
Community Member

Prevent canvas from removing empty div tags

Jump to solution

If I am editing a page's body field (HTML editor) and I add an empty div. For example: 

<div class="write-in-me-later"></div>

Upon save this div is excised from the page, reopening the editor will find it missing. 

Is there any way to prevent this removal behavior. I would like to be able to set up the html structure of a page before all the content is ready. 

Thanks

Labels (1)
0 Kudos
2 Solutions
nwilson7
Community Champion

@WillKP I don't believe there is a way to prevent Canvas from doing the "clean up" on the HTML.  I have put in "XXX" or lorem ipsum as place holders to hold things in place and to see what it will look like with content.

Hope this helps!

-Nick

View solution in original post

0 Kudos
Chris_Hofer
Community Coach
Community Coach

Hi there, @WillKP ...

In addition to the information that you received from @nwilson7, this document might be of help to you:

Canvas HTML Editor Allowlist PDF

View solution in original post

0 Kudos
4 Replies
nwilson7
Community Champion

@WillKP I don't believe there is a way to prevent Canvas from doing the "clean up" on the HTML.  I have put in "XXX" or lorem ipsum as place holders to hold things in place and to see what it will look like with content.

Hope this helps!

-Nick

0 Kudos

Thank you for your reply, though I don't consider this to be a solution. If possible I would like to escalate this to "feature request" if there is such a thing. 

Possible solutions. 

  1. Don't strip empty HTML tags
  2. Allow for any empty div that has a class or id attribute to be kept
  3. Provide affordance for special attribute that skips the empty div removal cleanup step. i.e. <div data-keep></div>
0 Kudos
Chris_Hofer
Community Coach
Community Coach

Hi there, @WillKP ...

In addition to the information that you received from @nwilson7, this document might be of help to you:

Canvas HTML Editor Allowlist PDF

0 Kudos
nwilson7
Community Champion

@WillKP  Here are some links you may find helpful about creating a feature request.  They are under the "roadmap" area of the community.  I did not see any ideas yet for this in the quick search I did.

-Nick