5 * Contains \Drupal\linkit\Plugin\Linkit\Matcher\TermMatcher.
8 namespace Drupal\linkit\Plugin\Linkit\Matcher;
10 use Drupal\Core\Form\FormStateInterface;
11 use Drupal\linkit\Utility\LinkitXss;
15 * id = "entity:taxonomy_term",
16 * target_entity = "taxonomy_term",
17 * label = @Translation("Taxonomy term"),
18 * provider = "taxonomy"
21 class TermMatcher extends EntityMatcher {
26 public function calculateDependencies() {
27 return parent::calculateDependencies() + [
28 'module' => ['taxonomy'],
35 public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
36 $form = parent::buildConfigurationForm($form, $form_state);
37 $this->insertTokenList($form, ['term']);
44 protected function buildDescription($entity) {
45 $description = \Drupal::token()->replace($this->configuration['result_description'], ['term' => $entity], []);
46 return LinkitXss::descriptionFilter($description);