-
-
Notifications
You must be signed in to change notification settings - Fork 200
Open
Description
Description
I would like to customize the extension https://commonmark.thephpleague.com/2.3/extensions/attributes/ so that you can limit the attributes of the user by configuration. Currently I give the user too much freedom once the extension is activated because e.g. I only want the user to be able to set values for bootstrap pull-left
as class.
If restricted
is true
(default: false
that there is no BC), then only the keys in the configuration are allowed. If false
, then only the values of the specified keys are restricted.
Example
'attributes' => [
'restricted' => true,
'class' => ['multiple value', 'allowed'],
'id' => 'allowed_value',
'title' => function ($value) {
if (strlen($value) > 10) {
return true;
} else {
return false;
}
},
// Allow the key and accept any value in case the restricted is true
'font' => null,
]
Did this project help you today? Did it make you happy in any way?
No response
Metadata
Metadata
Assignees
Labels
enhancementNew functionality or behaviorNew functionality or behavior