Skip to content

Ability to blacklist or whitelist certain parsers. #648

Answered by colinodell
doZennn asked this question in Q&A
Discussion options

You must be logged in to vote

The general gist is that you create your own custom extension which only registers the parsers, renderers, etc. for the features you want to support.

Here's the CommonMarkCoreExtension which includes almost everything: https://github.com/thephpleague/commonmark/blob/master/src/Extension/CommonMarkCoreExtension.php

Here's the InlinesOnly extension which only includes things you'd typically find in one-line comments: https://github.com/thephpleague/commonmark/blob/master/src/Extension/InlinesOnly/InlinesOnlyExtension.php

You can use one of those as-is or create your own version to fit your own needs.

I definitely agree that the documentation could be better - PRs would be welcome! 😉

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by colinodell
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question General questions about the project or usage
3 participants
Converted from issue

This discussion was converted from issue #414 on June 12, 2021 14:02.