Skip to content
Snippets Groups Projects
Verified Commit 1e89b0ca authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3421012 by sorlov, quietone, sakthi_dev, mstrelan, Wim Leers: Convert...

Issue #3421012 by sorlov, quietone, sakthi_dev, mstrelan, Wim Leers: Convert Filter plugin discovery to attributes

(cherry picked from commit 1d07b822)
parent a3a4d885
Branches
Tags
28 merge requests!11958Issue #3490507 by alexpott, smustgrave: Fix bogus mocking in...,!11769Issue #3517987: Add option to contextual filters to encode slashes in query parameter.,!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!10602Issue #3438769 by vinmayiswamy, antonnavi, michelle, amateescu: Sub workspace does not clear,!10301Issue #3469309 by mstrelan, smustgrave, moshe weitzman: Use one-time login...,!10187Issue #3487488 by dakwamine: ExtensionMimeTypeGuesser::guessMimeType must support file names with "0" (zero) like foo.0.zip,!9944Issue #3483353: Consider making the createCopy config action optionally fail...,!9929Issue #3445469 by pooja_sharma, smustgrave: Add additional test coverage for...,!9787Resolve issue 3479427 - bootstrap barrio issue under Windows,!9742Issue #3463908 by catch, quietone: Split OptionsFieldUiTest into two,!9526Issue #3458177 by mondrake, catch, quietone, godotislate, longwave, larowlan,...,!8738Issue #3424162 by camilledavis, dineshkumarbollu, smustgrave: Claro...,!8704Make greek characters available in ckeditor5,!8597Draft: Issue #3442259 by catch, quietone, dww: Reduce time of Migrate Upgrade tests...,!8533Issue #3446962 by kim.pepper: Remove incorrectly added...,!8517Issue #3443748 by NexusNovaz, smustgrave: Testcase creates false positive,!8325Update file Sort.php,!8095Expose document root on install,!7930Resolve #3427374 "Taxonomytid viewsargumentdefault plugin",!7627Issue #3439440 by nicxvan, Binoli Lalani, longwave: Remove country support from DateFormatter,!7445Issue #3440169: When using drupalGet(), provide an associative array for $headers,!7401#3271894 Fix documented StreamWrapperInterface return types for realpath() and dirname(),!7384Add constraints to system.advisories,!7078Issue #3320569 by Spokje, mondrake, smustgrave, longwave, quietone, Lendude,...,!6622Issue #2559833 by piggito, mohit_aghera, larowlan, guptahemant, vakulrai,...,!6502Draft: Resolve #2938524 "Plach testing issue",!38582585169-10.1.x,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key
Pipeline #114587 passed with warnings
Pipeline: drupal

#114592

    Pipeline: drupal

    #114589

      Showing
      with 227 additions and 134 deletions
      ......@@ -2,18 +2,20 @@
      namespace Drupal\ckeditor5_incompatible_filter_test\Plugin\Filter;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a filter incompatible with CKEditor 5.
      *
      * @Filter(
      * id = "filter_incompatible",
      * title = @Translation("A TYPE_MARKUP_LANGUAGE filter incompatible with CKEditor 5"),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE
      * )
      */
      #[Filter(
      id: "filter_incompatible",
      title: new TranslatableMarkup("A TYPE_MARKUP_LANGUAGE filter incompatible with CKEditor 5"),
      type: FilterInterface::TYPE_MARKUP_LANGUAGE
      )]
      class FilterIsIncompatible extends FilterBase {
      /**
      ......
      ......@@ -6,23 +6,25 @@
      use Drupal\Core\Entity\EntityRepositoryInterface;
      use Drupal\Core\Image\ImageFactory;
      use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\file\FileInterface;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      use Symfony\Component\DependencyInjection\ContainerInterface;
      /**
      * Provides a filter to track images uploaded via a Text Editor.
      *
      * Generates file URLs and associates the cache tags of referenced files.
      *
      * @Filter(
      * id = "editor_file_reference",
      * title = @Translation("Track images uploaded via a Text Editor"),
      * description = @Translation("Ensures that the latest versions of images uploaded via a Text Editor are displayed, along with their dimensions."),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      * )
      */
      #[Filter(
      id: "editor_file_reference",
      title: new TranslatableMarkup("Track images uploaded via a Text Editor"),
      description: new TranslatableMarkup("Ensures that the latest versions of images uploaded via a Text Editor are displayed, along with their dimensions."),
      type: FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      )]
      class EditorFileReference extends FilterBase implements ContainerFactoryPluginInterface {
      /**
      ......
      <?php
      declare(strict_types=1);
      namespace Drupal\filter\Attribute;
      use Drupal\Component\Plugin\Attribute\Plugin;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      /**
      * Defines a filter attribute for plugin discovery.
      *
      * Plugin Namespace: Plugin\Filter
      *
      * For a working example, see \Drupal\filter\Plugin\Filter\FilterHtml
      *
      * @see \Drupal\filter\FilterPluginManager
      * @see \Drupal\filter\Plugin\FilterInterface
      * @see \Drupal\filter\Plugin\FilterBase
      * @see plugin_api
      */
      #[\Attribute(\Attribute::TARGET_CLASS)]
      class Filter extends Plugin {
      /**
      * Constructs a Filter attribute.
      *
      * @param string $id
      * The plugin ID.
      * @param \Drupal\Core\StringTranslation\TranslatableMarkup $title
      * The human-readable name of the filter. This is used as an administrative
      * summary of what the filter does.
      * @param int $type
      * The filter type. Values are defined in
      * \Drupal\filter\Plugin\FilterInterface.
      * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $description
      * (optional) Additional administrative information about the filter's
      * behavior.
      * @param int $weight
      * (optional) A default weight for the filter in new text formats.
      * @param bool $status
      * (optional) Whether this filter is enabled or disabled by default.
      * @param array $settings
      * (optional) The default settings for the filter.
      */
      public function __construct(
      public readonly string $id,
      public readonly TranslatableMarkup $title,
      public readonly int $type,
      public readonly ?TranslatableMarkup $description = NULL,
      public readonly int $weight = 0,
      public readonly bool $status = FALSE,
      public readonly array $settings = [],
      ) {}
      }
      ......@@ -6,6 +6,7 @@
      use Drupal\Core\Cache\CacheBackendInterface;
      use Drupal\Core\Extension\ModuleHandlerInterface;
      use Drupal\Core\Plugin\DefaultPluginManager;
      use Drupal\filter\Attribute\Filter;
      /**
      * Manages text processing filters.
      ......@@ -30,7 +31,7 @@ class FilterPluginManager extends DefaultPluginManager implements FallbackPlugin
      * The module handler to invoke the alter hook with.
      */
      public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
      parent::__construct('Plugin/Filter', $namespaces, $module_handler, 'Drupal\filter\Plugin\FilterInterface', 'Drupal\filter\Annotation\Filter');
      parent::__construct('Plugin/Filter', $namespaces, $module_handler, 'Drupal\filter\Plugin\FilterInterface', Filter::class, 'Drupal\filter\Annotation\Filter');
      $this->alterInfo('filter_info');
      $this->setCacheBackend($cache_backend, 'filter_plugins');
      }
      ......
      ......@@ -3,19 +3,21 @@
      namespace Drupal\filter\Plugin\Filter;
      use Drupal\Component\Utility\Html;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a filter to align elements.
      *
      * @Filter(
      * id = "filter_align",
      * title = @Translation("Align images"),
      * description = @Translation("Uses a <code>data-align</code> attribute on <code>&lt;img&gt;</code> tags to align images."),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      * )
      */
      #[Filter(
      id: "filter_align",
      title: new TranslatableMarkup("Align images"),
      description: new TranslatableMarkup("Uses a <code>data-align</code> attribute on <code>&lt;img&gt;</code> tags to align images."),
      type: FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
      )]
      class FilterAlign extends FilterBase {
      /**
      ......
      ......@@ -2,18 +2,20 @@
      namespace Drupal\filter\Plugin\Filter;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a filter to convert line breaks to HTML.
      *
      * @Filter(
      * id = "filter_autop",
      * title = @Translation("Convert line breaks into HTML (i.e. <code>&lt;br&gt;</code> and <code>&lt;p&gt;</code>)"),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE
      * )
      */
      #[Filter(
      id: "filter_autop",
      title: new TranslatableMarkup("Convert line breaks into HTML (i.e. <code>&lt;br&gt;</code> and <code>&lt;p&gt;</code>)"),
      type: FilterInterface::TYPE_MARKUP_LANGUAGE
      )]
      class FilterAutoP extends FilterBase {
      /**
      ......
      ......@@ -4,9 +4,12 @@
      use Drupal\Component\Utility\Html;
      use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterPluginManager;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      use Drupal\filter\Render\FilteredMarkup;
      use Symfony\Component\DependencyInjection\ContainerInterface;
      ......@@ -14,14 +17,13 @@
      * Provides a filter to caption elements.
      *
      * When used in combination with the filter_align filter, this must run last.
      *
      * @Filter(
      * id = "filter_caption",
      * title = @Translation("Caption images"),
      * description = @Translation("Uses a <code>data-caption</code> attribute on <code>&lt;img&gt;</code> tags to caption images."),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      * )
      */
      #[Filter(
      id: "filter_caption",
      title: new TranslatableMarkup("Caption images"),
      description: new TranslatableMarkup("Uses a <code>data-caption</code> attribute on <code>&lt;img&gt;</code> tags to caption images."),
      type: FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      )]
      class FilterCaption extends FilterBase implements ContainerFactoryPluginInterface {
      /**
      ......
      ......@@ -4,9 +4,12 @@
      use Drupal\Component\Utility\Xss;
      use Drupal\Core\Form\FormStateInterface;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\Component\Utility\Html;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      use Masterminds\HTML5\Parser\DOMTreeBuilder;
      use Masterminds\HTML5\Parser\Scanner;
      use Masterminds\HTML5\Parser\Tokenizer;
      ......@@ -17,19 +20,18 @@
      * The attributes in the annotation show examples of allowing all attributes
      * by only having the attribute name, or allowing a fixed list of values, or
      * allowing a value with a wildcard prefix.
      *
      * @Filter(
      * id = "filter_html",
      * title = @Translation("Limit allowed HTML tags and correct faulty HTML"),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_HTML_RESTRICTOR,
      * settings = {
      * "allowed_html" = "<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>",
      * "filter_html_help" = TRUE,
      * "filter_html_nofollow" = FALSE
      * },
      * weight = -10
      * )
      */
      #[Filter(
      id: "filter_html",
      title: new TranslatableMarkup("Limit allowed HTML tags and correct faulty HTML"),
      type: FilterInterface::TYPE_HTML_RESTRICTOR,
      weight: -10,
      settings: [
      "allowed_html" => "<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>",
      "filter_html_help" => TRUE,
      "filter_html_nofollow" => FALSE,
      ],
      )]
      class FilterHtml extends FilterBase {
      /**
      ......
      ......@@ -3,19 +3,21 @@
      namespace Drupal\filter\Plugin\Filter;
      use Drupal\Component\Utility\Html;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a filter to correct faulty and chopped off HTML.
      *
      * @Filter(
      * id = "filter_htmlcorrector",
      * title = @Translation("Correct faulty and chopped off HTML"),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
      * weight = 10
      * )
      */
      #[Filter(
      id: "filter_htmlcorrector",
      title: new TranslatableMarkup("Correct faulty and chopped off HTML"),
      type: FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
      weight: 10
      )]
      class FilterHtmlCorrector extends FilterBase {
      /**
      ......
      ......@@ -2,19 +2,21 @@
      namespace Drupal\filter\Plugin\Filter;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a filter to display any HTML as plain text.
      *
      * @Filter(
      * id = "filter_html_escape",
      * title = @Translation("Display any HTML as plain text"),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_HTML_RESTRICTOR,
      * weight = -10
      * )
      */
      #[Filter(
      id: "filter_html_escape",
      title: new TranslatableMarkup("Display any HTML as plain text"),
      type: FilterInterface::TYPE_HTML_RESTRICTOR,
      weight: -10
      )]
      class FilterHtmlEscape extends FilterBase {
      /**
      ......
      ......@@ -2,20 +2,22 @@
      namespace Drupal\filter\Plugin\Filter;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a filter to restrict images to site.
      *
      * @Filter(
      * id = "filter_html_image_secure",
      * title = @Translation("Restrict images to this site"),
      * description = @Translation("Disallows usage of &lt;img&gt; tag sources that are not hosted on this site by replacing them with a placeholder image."),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
      * weight = 9
      * )
      */
      #[Filter(
      id: "filter_html_image_secure",
      title: new TranslatableMarkup("Restrict images to this site"),
      description: new TranslatableMarkup("Disallows usage of &lt;img&gt; tag sources that are not hosted on this site by replacing them with a placeholder image."),
      type: FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
      weight: 9
      )]
      class FilterHtmlImageSecure extends FilterBase {
      /**
      ......
      ......@@ -5,20 +5,22 @@
      namespace Drupal\filter\Plugin\Filter;
      use Drupal\Component\Utility\Html;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a filter to lazy load tracked images.
      *
      * @Filter(
      * id = "filter_image_lazy_load",
      * title = @Translation("Lazy load images"),
      * description = @Translation("Instruct browsers to lazy load images if dimensions are specified. Use in conjunction with and place after the 'Track images uploaded via a Text Editor' filter that adds image dimensions required for lazy loading. Results can be overridden by <code>&lt;img loading=&quot;eager&quot;&gt;</code>."),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
      * weight = 15
      * )
      */
      #[Filter(
      id: "filter_image_lazy_load",
      title: new TranslatableMarkup("Lazy load images"),
      description: new TranslatableMarkup("Instruct browsers to lazy load images if dimensions are specified. Use in conjunction with and place after the 'Track images uploaded via a Text Editor' filter that adds image dimensions required for lazy loading. Results can be overridden by <code>&lt;img loading=&quot;eager&quot;&gt;</code>."),
      type: FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
      weight: 15
      )]
      final class FilterImageLazyLoad extends FilterBase {
      /**
      ......
      ......@@ -2,8 +2,11 @@
      namespace Drupal\filter\Plugin\Filter;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a fallback placeholder filter to use for missing filters.
      ......@@ -11,14 +14,13 @@
      * The filter system uses this filter to replace missing filters (for example,
      * if a filter module has been disabled) that are still part of defined text
      * formats. It returns an empty string.
      *
      * @Filter(
      * id = "filter_null",
      * title = @Translation("Provides a fallback for missing filters. Do not use."),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_HTML_RESTRICTOR,
      * weight = -10
      * )
      */
      #[Filter(
      id: "filter_null",
      title: new TranslatableMarkup("Provides a fallback for missing filters. Do not use."),
      type: FilterInterface::TYPE_HTML_RESTRICTOR,
      weight: -10
      )]
      class FilterNull extends FilterBase {
      /**
      ......
      ......@@ -3,21 +3,23 @@
      namespace Drupal\filter\Plugin\Filter;
      use Drupal\Core\Form\FormStateInterface;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a filter to convert URLs into links.
      *
      * @Filter(
      * id = "filter_url",
      * title = @Translation("Convert URLs into links"),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE,
      * settings = {
      * "filter_url_length" = 72
      * }
      * )
      */
      #[Filter(
      id: "filter_url",
      title: new TranslatableMarkup("Convert URLs into links"),
      type: FilterInterface::TYPE_MARKUP_LANGUAGE,
      settings: [
      "filter_url_length" => 72,
      ]
      )]
      class FilterUrl extends FilterBase {
      /**
      ......
      ......@@ -2,19 +2,21 @@
      namespace Drupal\filter_test\Plugin\Filter;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a test filter to attach assets.
      *
      * @Filter(
      * id = "filter_test_assets",
      * title = @Translation("Testing filter"),
      * description = @Translation("Does not change content; attaches assets."),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      * )
      */
      #[Filter(
      id: "filter_test_assets",
      title: new TranslatableMarkup("Testing filter"),
      description: new TranslatableMarkup("Does not change content; attaches assets."),
      type: FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      )]
      class FilterTestAssets extends FilterBase {
      /**
      ......
      ......@@ -2,20 +2,22 @@
      namespace Drupal\filter_test\Plugin\Filter;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\Core\Language\LanguageInterface;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a test filter to associate cache contexts.
      *
      * @Filter(
      * id = "filter_test_cache_contexts",
      * title = @Translation("Testing filter"),
      * description = @Translation("Does not change content; associates cache contexts."),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      * )
      */
      #[Filter(
      id: "filter_test_cache_contexts",
      title: new TranslatableMarkup("Testing filter"),
      description: new TranslatableMarkup("Does not change content; associates cache contexts."),
      type: FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      )]
      class FilterTestCacheContexts extends FilterBase {
      /**
      ......
      ......@@ -2,20 +2,22 @@
      namespace Drupal\filter_test\Plugin\Filter;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\Core\Cache\CacheableMetadata;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a test filter to merge with CacheableMetadata.
      *
      * @Filter(
      * id = "filter_test_cache_merge",
      * title = @Translation("Testing filter"),
      * description = @Translation("Does not change content; merges cacheable metadata."),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      * )
      */
      #[Filter(
      id: "filter_test_cache_merge",
      title: new TranslatableMarkup("Testing filter"),
      description: new TranslatableMarkup("Does not change content; merges cacheable metadata."),
      type: FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      )]
      class FilterTestCacheMerge extends FilterBase {
      /**
      ......
      ......@@ -2,19 +2,21 @@
      namespace Drupal\filter_test\Plugin\Filter;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a test filter to associate cache tags.
      *
      * @Filter(
      * id = "filter_test_cache_tags",
      * title = @Translation("Testing filter"),
      * description = @Translation("Does not change content; associates cache tags."),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      * )
      */
      #[Filter(
      id: "filter_test_cache_tags",
      title: new TranslatableMarkup("Testing filter"),
      description: new TranslatableMarkup("Does not change content; associates cache tags."),
      type: FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      )]
      class FilterTestCacheTags extends FilterBase {
      /**
      ......
      ......@@ -2,21 +2,23 @@
      namespace Drupal\filter_test\Plugin\Filter;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\Component\Render\FormattableMarkup;
      use Drupal\Core\Security\TrustedCallbackInterface;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a test filter to use placeholders.
      *
      * @Filter(
      * id = "filter_test_placeholders",
      * title = @Translation("Testing filter"),
      * description = @Translation("Appends a placeholder to the content; associates #lazy_builder callback."),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      * )
      */
      #[Filter(
      id: "filter_test_placeholders",
      title: new TranslatableMarkup("Testing filter"),
      description: new TranslatableMarkup("Appends a placeholder to the content; associates #lazy_builder callback."),
      type: FilterInterface::TYPE_TRANSFORM_REVERSIBLE
      )]
      class FilterTestPlaceholders extends FilterBase implements TrustedCallbackInterface {
      /**
      ......
      ......@@ -2,19 +2,21 @@
      namespace Drupal\filter_test\Plugin\Filter;
      use Drupal\Core\StringTranslation\TranslatableMarkup;
      use Drupal\filter\Attribute\Filter;
      use Drupal\filter\FilterProcessResult;
      use Drupal\filter\Plugin\FilterBase;
      use Drupal\filter\Plugin\FilterInterface;
      /**
      * Provides a test filter to replace all content.
      *
      * @Filter(
      * id = "filter_test_replace",
      * title = @Translation("Testing filter"),
      * description = @Translation("Replaces all content with filter and text format information."),
      * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE
      * )
      */
      #[Filter(
      id: "filter_test_replace",
      title: new TranslatableMarkup("Testing filter"),
      description: new TranslatableMarkup("Replaces all content with filter and text format information."),
      type: FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE
      )]
      class FilterTestReplace extends FilterBase {
      /**
      ......
      0% Loading or .
      You are about to add 0 people to the discussion. Proceed with caution.
      Please register or to comment