Forum Discussion

Kirk Liemohn's avatar
Kirk Liemohn
Brass Contributor
Aug 01, 2018

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...
  • BertJansen's avatar
    BertJansen
    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.

Resources