-
-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable the restriction of attributes #942
Comments
I like the idea! I'd recommend moving all the attributes into a separate array in the configuration (so we're not listing them alongside any other non-attribute keys) - maybe even something like this:
If And I see three ways we could represent keys that allow any values:
I don't have a strong preference either way on this. Are you open to implementing this yourself? If so, please feel free to create a new PR from the |
I prefer "null" or value only, because this way we may allow values to be interpreted later. 'attributes' => [
'allowed' => [
'data-enable' => true, // true
// false
That's exactly what I was planning to do, extend it via pull request, just wanted to make sure if you agreed with that before I bothered. |
That works for me! |
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
istrue
(default:false
that there is no BC), then only the keys in the configuration are allowed. Iffalse
, then only the values of the specified keys are restricted.Example
Did this project help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: