Open controlnocontrol opened 6 years ago
This syntax might be cleaner and allow choice of tags and classes as well as multiple nesting:
"example": {
"args": {
"tag": "div",
"class": "parent",
"args": {
"tag": "p",
"class": "child"
}
}
}
This would also be helpful for customizing unordered lists:
"check bullet": {
"args": {
"tag": "ul",
"class": "checked",
"args": {
"tag": "li"
}
}
}
@ohbiko thanks for the interesting suggestion. Do you know if Redactor allows nested block level elements at all, and how the Formatting feature (h1, p, etc.) behaves when a nested element, for example div in div, is selected? I have a feeling that the API doesn’t really support it.
@jasonmckinney66 I also came across this issue recently that you can’t configure a button to add classes to a ul tag. According to docs this should work, but it does not.
"specialList": {
"api": "module.block.format",
"args": {
"tag": "ul",
"class": "align-right"
}
}
You can also replicate with a formattingAdd
configuration, which uses the same API.
https://imperavi.com/redactor/docs/settings/formatting/#s-formattingadd https://imperavi.com/redactor/docs/api-modules/
Is it possible to specify a parent tag?
E.g. something like:
will produce