#10471 closed New Feature (duplicate)
CKEDITOR.filter rules aren't versatile enough in certain case. e.g.: allow all data attributes
Reported by: | Daazku | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Output Data | Version: | 4.0 Beta |
Keywords: | ACF | Cc: |
Description
As the title says there is some problem with the current implementation of CKEDITOR.filter.
It cannot allow all possible data attributes.
It would be great if I could type data-* (If we do it regex like it would be data-+ in that case) so that all data attributes matches.
This could even be extended to style or class as well. eg: background* would match background, background-color, background-position...
I put it as new features but it might be a "bug" because I actually have no way to allow all data attributes and it is painful to allow generic.
Change History (5)
comment:2 follow-up: 3 Changed 12 years ago by
Keywords: | data filter removed |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Version: | 4.1.1 → 4.0 Beta |
This is an exact duplicate of #10202, which we will fortunately include in the next major release. There will be possible even more when using the object format, because full regexp format will be available.
The workaround for now could also be to use the match
property of object format rule (an example can be found here: https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/pagebreak/plugin.js#L129-L140), however your solution is more straightforward.
comment:3 Changed 12 years ago by
Replying to Reinmar:
This is an exact duplicate of #10202, which we will fortunately include in the next major release. There will be possible even more when using the object format, because full regexp format will be available.
The workaround for now could also be to use the
match
property of object format rule (an example can be found here: https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/pagebreak/plugin.js#L129-L140), however your solution is more straightforward.
Sorry for the duplicate. Seems like I didn't search enough!
About match: Would it not only allows the element? From what I understood from the code you have no access to the status object so you cannot put the "data" attributes to be valid which will cause them to be stripped anyway.
If i'm not wrong, it may be useful to get a reference to the status object in the match function. However with the proposed fix in #10202 it may not be necessary.
comment:4 follow-up: 5 Changed 12 years ago by
Sorry for the duplicate. Seems like I didn't search enough!
No problem. It's usually hard to find anything here ;).
About match: Would it not only allows the element? From what I understood from the code you have no access to the status object so you cannot put the "data" attributes to be valid which will cause them to be stripped anyway.
If i'm not wrong, it may be useful to get a reference to the status object in the match function. However with the proposed fix in #10202 it may not be necessary.
I'm surprised by how much you know about the filter :). I hope you liked its code.
Regarding match
- it just allows to make a decision whether rule can be applied to a specific element. Nothing more. So, it could be used to partially solve your issue and in not very clear way.
I was also thinking whether it would be handy to give access to a status object from some rule's callback (match
or... exec
- dunno). It would be powerful, but at the same time, unless it has a good API, it would work in mysterious way :). Thus, I'm not planning to work on this before I have a real case.
comment:5 Changed 12 years ago by
Replying to Reinmar:
Sorry for the duplicate. Seems like I didn't search enough!
No problem. It's usually hard to find anything here ;).
About match: Would it not only allows the element? From what I understood from the code you have no access to the status object so you cannot put the "data" attributes to be valid which will cause them to be stripped anyway.
If i'm not wrong, it may be useful to get a reference to the status object in the match function. However with the proposed fix in #10202 it may not be necessary.
I'm surprised by how much you know about the filter :). I hope you liked its code.
I had to check the code to know what were my possibilities about matching data-* . Yeah I liked the code alot! Good comments and clever implementation!
Regarding
match
- it just allows to make a decision whether rule can be applied to a specific element. Nothing more. So, it could be used to partially solve your issue and in not very clear way.I was also thinking whether it would be handy to give access to a status object from some rule's callback (
match
or...exec
- dunno). It would be powerful, but at the same time, unless it has a good API, it would work in mysterious way :). Thus, I'm not planning to work on this before I have a real case.
Like I said it could be useful but not necessary at all for the moment!
Continue the good work!
Workaround for now: