Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

sp webpart base.iwebpartpropertymetadata.ishtmlstring

John Nguyen edited this page Apr 22, 2021 · 2 revisions

Home > @microsoft/sp-webpart-base > IWebPartPropertyMetadata > isHtmlString

IWebPartPropertyMetadata.isHtmlString property

Indicates whether the property should be serialized as HTML.

Signature:

isHtmlString?: boolean;

Remarks

This flag instructs framework to store the value as HTML, so that SharePoint can perform the following services on it:

  • normalizing HTML encodings

  • stripping unsafe HTML tags (i.e. for usage with Element.innerHTML)

  • search indexing

  • SharePoint link fix-up

Only enable this flag for HTML content where these modifications are acceptable. If non-HTML content is provided, SharePoint framework might make modifications to convert it to HTML valid. For plain text content that simply needs to be exposed to the search index (without any rewriting), use the isSearchablePlainText flag instead.

Clone this wiki locally