HtmlValidationContext.AllowHeadings Property

Definition

Gets or sets the constraint that allows heading tags to be added in the HTML.

public:
 property bool AllowHeadings { bool get(); void set(bool value); };
public bool AllowHeadings { get; set; }
member this.AllowHeadings : bool with get, set
Public Property AllowHeadings As Boolean

Property Value

Boolean

Default is True.

Examples

// Set the constraint properties to any desired combination of true and false
      validationContext.AllowFonts = true;
      validationContext.AllowHeadings = false;
      validationContext.AllowHyperlinks = true;
      validationContext.AllowImages = false;
      validationContext.AllowLists = false;
      validationContext.AllowTables = true;
      validationContext.AllowTextMarkup = false;
      <p>
        <strong>Note</strong>: This example is part of the larger ValidateHtmlCode sample in the <xref data-throw-if-not-resolved="true" uid="Microsoft.SharePoint.Publishing.Fields.HtmlValidationContext"></xref> topic.</p>

Remarks

When set to True, heading tags are allowed. If you set this flag to False, the following tags are removed from the HTML:

<DIR>, <H1>, <H2>, <H3>, <H4>, <H5>, <H6>, <MARQUEE>, <ADDRESS> and <CENTER>.

Applies to