How to customize External Links extension in Symfony 4/5? #784
Unanswered
StefanGlaesser
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Your custom extension probably needs to final class MarkdownExternalLinkExtension implements ExtensionInterface
{
public function register(ConfigurableEnvironmentInterface $environment): void
{
// TODO: Do whatever you need to do here
}
} I'm not super familiar with the inner workings of the Twig integration, but hopefully that points you in the right direction :) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
currently I'm using Symfony 4 and the twig/markdown-extra with the league/commonmark extension.
I would like to customize the external link behavior as it is described here:
https://commonmark.thephpleague.com/2.1/extensions/external-links/
There is also a note on https://twig.symfony.com/doc/3.x/filters/markdown_to_html.html
"If using Symfony (full-stack), twig/extra-bundle with league/commonmark as your Markdown library you can configure CommonMark extensions. Register the desired extension(s) as a service, then tag the service with twig.markdown.league_extension."
So I created an Service
and tagged the service as described:
But my registered extension doesn't do anything :(
Has someone implemented in Symfony and can give me a hint?
Best regards,
Stefan
Beta Was this translation helpful? Give feedback.
All reactions