Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LeagueMarkdown converter is explicitly requiring CommonMarkConverter #3581

Open
trickeyone opened this issue Oct 25, 2021 · 1 comment
Open
Labels

Comments

@trickeyone
Copy link

trickeyone commented Oct 25, 2021

League CommonMark: v1.6.6
Twig Markdown-Extra: v3.3.3
Twig: v3.3.3

The LeagueMarkdown constructor is requiring the $converter parameter to explicitly be an instance of CommonMarkConverter, however with League CommonMark v1.6, the converter looks to have been split into two different instance types:

  1. MarkdownConverter
  2. CommonMarkConverter which extends MarkdownConverter

For our usage, we're needing to pass-in the $environment to the converter (GitHub flavor with some other slight modifications) So, with v1.6, we can't use CommonMarkConverter since it triggers a deprecation error:

Passing an $environment into the "League\CommonMark\CommonMarkConverter" constructor is deprecated in 1.6 and will not be supported in 2.0; use MarkdownConverter instead. See https://commonmark.thephpleague.com/2.0/upgrading/consumers/#commonmarkconverter-and-githubflavoredmarkdownconverter-constructors for more details.

Would it be possible to change the constructor for LeagueMarkdown to only require MarkdownConverter or maybe even just the ConverterInterface?

@stof
Copy link
Member

stof commented Oct 26, 2021

Typehinting the MarkdownConverterInterface makes sense. Do you want to send a PR for that ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants