Forum Discussion
Kirk Liemohn
Aug 01, 2018Brass Contributor
Migrating HTML to Modern Pages - Looks great until page is edited, then content is lost
We are migrating HTML to modern pages using code like: var page = context.Web.AddClientSidePage(pageName, true); page.PageTitle = "some title"; string htmlContent = "<some html content from ano...
- Aug 02, 2018
The easiest way to understand what's valid HTML is to create a piece of text using all the layout and formatting options you need. Once you've that you can grab the page list item and look at the canvascontent1 field to obtain the generated HTML. You'll see that only a limited number of styles are supported and fixed set of classes for color and size information. Anything else you use can be initially displayed but will be lost during edit.
Aug 01, 2018
Perhaps some content cleaning on client side that you avoid when using c#?