public function registerConverter(OutputConverterInterface $converter) {
        foreach ($converter->getSupportedMimeTypes() as $mimeType => $extensions) {
            if (!is_array($extensions)) {
                $extensions = [$extensions];
            }

            if (!isset($this->convertersByMimeType[$mimeType])) {
                $this->convertersByMimeType[$mimeType] = [];
            }

            if (!isset($this->mimeTypeToExtension[$mimeType])) {
                $this->mimeTypeToExtension[$mimeType] = $extensions[0];
            }

            $this->convertersByMimeType[$mimeType][] = $converter;

            foreach ($extensions as $extension) {
                if (!isset($this->convertersByExtension[$extension])) {
                    $this->convertersByExtension[$extension] = [];
                }

                if (!isset($this->extensionToMimeType[$extension])) {
                    $this->extensionToMimeType[$extension] = $mimeType;
                }

                $this->convertersByExtension[$extension][] = $converter;
            }
        }

        return $this;
    }