You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The attached code, when run on PHP 8.1.27, will produce:
Uncaught Nette\Schema\ValidationException: Unexpected item 'commonmark › unordered_list_markers'. in /[…]/vendor/nette/schema/src/Schema/Processor.php:85
If line 18 is changed so no config array is passed ($env = new Environment();), the code produces:
Uncaught Dflydev\DotAccessData\Exception\MissingPathException: No data exists at the given path: "commonmark » unordered_list_markers" in /[…]/vendor/dflydev/dot-access-data/src/Data.php:132
Context: We're using code similar to this to limit the MD features that untrusted users can use when leaving comments on pages on our site, so I'm not using the CommonMarkCoreExtension(). Instead I'm using the InlinesOnlyExtension() and then adding a couple blocks we want to allow. Lists are one of the things we want to allow, but after (finally) upgrading from 1.x, I've run into this issue.
The default configuration should be used if no configuration is present when creating the Environment. Either way no exception should be thrown. I'm afraid I don't really understand how that config package works to suggest something less obvious than this.
Additional context
No response
Did this project help you today? Did it make you happy in any way?
<3
The text was updated successfully, but these errors were encountered:
For your use case I'd recommend copying InlinesOnlyExtension into your own custom extension and adding the missing config option (plus the additional parser/renderers too)
The default configuration should be used if no configuration is present when creating the Environment.
Yeah, this is one of the few reasons I'm not super happy with how configuration works today. I'm hoping to revisit the configuration implementation for v3, but I have no ETA on that.
Version(s) affected
2.4.2
Description
The attached code, when run on PHP 8.1.27, will produce:
Uncaught Nette\Schema\ValidationException: Unexpected item 'commonmark › unordered_list_markers'. in /[…]/vendor/nette/schema/src/Schema/Processor.php:85
If line 18 is changed so no config array is passed (
$env = new Environment();
), the code produces:Uncaught Dflydev\DotAccessData\Exception\MissingPathException: No data exists at the given path: "commonmark » unordered_list_markers" in /[…]/vendor/dflydev/dot-access-data/src/Data.php:132
Context: We're using code similar to this to limit the MD features that untrusted users can use when leaving comments on pages on our site, so I'm not using the CommonMarkCoreExtension(). Instead I'm using the InlinesOnlyExtension() and then adding a couple blocks we want to allow. Lists are one of the things we want to allow, but after (finally) upgrading from 1.x, I've run into this issue.
How to reproduce
Possible solution
The default configuration should be used if no configuration is present when creating the Environment. Either way no exception should be thrown. I'm afraid I don't really understand how that config package works to suggest something less obvious than this.
Additional context
No response
Did this project help you today? Did it make you happy in any way?
<3
The text was updated successfully, but these errors were encountered: