feature #4642 [CommonMark] Update configuration keys + allow extra keys for extensions (doekenorg)

This PR was merged into the 3.x branch.

Discussion
----------

[CommonMark] Update configuration keys + allow extra keys for extensions

This PR adds missing keys from the current version of CommonMark (2.7).

It also fixes a bug where extra keys are removed. The original intent was to keep the extra keys, so extensions could be configured as well. Currently, these keys are removed, meaning extensions can not be configured.

Original PR #3737.

Commits
-------

a8aadc3e99 Update configuration keys + allow extra keys for extensions
This commit is contained in:
Fabien Potencier
2025-05-23 04:16:20 -07:00
@@ -39,14 +39,14 @@ class Configuration implements ConfigurationInterface
}
/**
* Full configuration from {@link https://commonmark.thephpleague.com/2.3/configuration}.
* Full configuration from {@link https://commonmark.thephpleague.com/2.7/configuration}.
*/
private function addCommonMarkConfiguration(ArrayNodeDefinition $rootNode): void
{
$rootNode
->children()
->arrayNode('commonmark')
->ignoreExtraKeys()
->ignoreExtraKeys(false)
->children()
->arrayNode('renderer')
->info('Array of options for rendering HTML.')
@@ -68,6 +68,10 @@ class Configuration implements ConfigurationInterface
->info('The maximum nesting level for blocks.')
->defaultValue(\PHP_INT_MAX)
->end()
->integerNode('max_delimiters_per_line')
->info('The maximum number of strong/emphasis delimiters per line.')
->defaultValue(\PHP_INT_MAX)
->end()
->arrayNode('slug_normalizer')
->info('Array of options for configuring how URL-safe slugs are created.')
->children()