Class: EditorFeatureHTMLRule

Drupal. EditorFeatureHTMLRule

new Drupal.EditorFeatureHTMLRule()

Constructor for an editor feature HTML rule.

Intended to be used in combination with Drupal.EditorFeature.

A text editor feature rule object describes both:

  • required HTML tags, attributes, styles and classes: without these, the text editor feature is unable to function. It's possible that a
  • allowed HTML tags, attributes, styles and classes: these are optional in the strictest sense, but it is possible that the feature generates them.

The structure can be very clearly seen below: there's a "required" and an "allowed" key. For each of those, there are objects with the "tags", "attributes", "styles" and "classes" keys. For all these keys the values are initialized to the empty array. List each possible value as an array value. Besides the "required" and "allowed" keys, there's an optional "raw" key: it allows text editor implementations to optionally pass in their raw representation instead of the Drupal-defined representation for HTML rules.

See:
Example
tags: ['']
attributes: ['href', 'alt']
styles: ['color', 'text-decoration']
classes: ['external', 'internal']

Members

allowedobject

Properties:
Name Type Description
tags Array
attributes Array
styles Array
classes Array

rawnull

requiredobject

Properties:
Name Type Description
tags Array
attributes Array
styles Array
classes Array