settings. */ public function settingsForm(array $form, FormStateInterface $form_state); /** * Prepares the text for processing. * * Filters should not use the prepare method for anything other than escaping, * because that would short-circuit the control the user has over the order in * which filters are applied. * * @param string $text * The text string to be filtered. * @param string $langcode * The language code of the text to be filtered. * * @return string * The prepared, escaped text. */ public function prepare($text, $langcode); /** * Performs the filter processing. * * @param string $text * The text string to be filtered. * @param string $langcode * The language code of the text to be filtered. * * @return \Drupal\filter\FilterProcessResult * The filtered text, wrapped in a FilterProcessResult object, and possibly * with associated assets, cacheability metadata and placeholders. * * @see \Drupal\filter\FilterProcessResult */ public function process($text, $langcode); /** * Returns HTML allowed by this filter's configuration. * * May be implemented by filters of the FilterInterface::TYPE_HTML_RESTRICTOR * type, this won't be used for filters of other types; they should just * return FALSE. * * This callback function is only necessary for filters that strip away HTML * tags (and possibly attributes) and allows other modules to gain insight in * a generic manner into which HTML tags and attributes are allowed by a * format. * * @return array|false * A nested array with *either* of the following keys: * - 'allowed': (optional) the allowed tags as keys, and for each of those * tags (keys) either of the following values: * - TRUE to indicate any attribute is allowed * - FALSE to indicate no attributes are allowed * - an array to convey attribute restrictions: the keys must be * attribute names (which may use a wildcard, e.g. "data-*"), the * possible values are similar to the above: * - TRUE to indicate any attribute value is allowed * - FALSE to indicate the attribute is forbidden * - an array to convey attribute value restrictions: the key must * be attribute values (which may use a wildcard, e.g. "xsd:*"), * the possible values are TRUE or FALSE: to mark the attribute * value as allowed or forbidden, respectively * - 'forbidden_tags': (optional) the forbidden tags * * There is one special case: the "wildcard tag", "*": any attribute * restrictions on that pseudotag apply to all tags. * * If no restrictions apply, then FALSE must be returned. * * Here is a concrete example, for a very granular filter: * @code * array( * 'allowed' => array( * // Allows any attribute with any value on the