private function replaceInsertTag(array $elements): string
    {
        if (3 !== \count($elements)) {
            return '';
        }

        list($source, $value, $property) = $elements;

        $tag = $this->registry->get($source)->find($value);

        if (null === $tag) {
            return '';
        }

        if ('name' === $property) {
            return $tag->getName();
        }

        $data = $tag->getData();

        return isset($data[$property]) ? (string) $data[$property] : '';
    }