new 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.
Example
tags: ['<a>']
attributes: ['href', 'alt']
styles: ['color', 'text-decoration']
classes: ['external', 'internal']
Members
allowed :Object
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
tags |
Array | |
attributes |
Array | |
styles |
Array | |
classes |
Array |
raw :null
Type:
- null
required :Object
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
tags |
Array | |
attributes |
Array | |
styles |
Array | |
classes |
Array |