Replies: 1 comment
-
Hi there!
This could be done by parsing (but not rendering) the Markdown and checking the generated AST for the forbidden nodes. For example (untested): $markdown = '...'; // todo
$environment = new Environment();
$environment->addExtension(new CommonMarkCoreExtension());
$environment->addExtension(new GithubFlavoredMarkdownExtension());
$parser = new MarkdownParser($environment);
$ast = $parser->parse($markdown);
foreach ($ast->iterator() as $node) {
if ($node instanceof Table) {
echo "Hey, tables aren't allowed!";
}
}
We have an open feature request for this: #419. I don't have an ETA on when this might be implemented - it could be a long time. If you need something sooner I'd recommend looking at an alternative library like markdownlint |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to
Beta Was this translation helpful? Give feedback.
All reactions