When an user selects inline code or text inside a code block it makes no sense to enable the styling options in the toolbar. Code should not be styled. Therefore we disable the toolbar options when code is selected (newly created or existing). To ensure no such styles are applied at all we also disable controller.formatSelection() to apply styles to code blocks. That means both the GUI and the controller are blocked.
A major cleanup was made in #230 for this feature. Conclusion: We don't need a rule: We did not create a new RuleM for blocking the styles because we need to modify the UI as well. Rules are purely functional and are not the right place to block styles. In fact, the rules are designed to apply additional manipulations/edits on the document. So It's clearly not the right place to write the styling blocking code for code blocks and inlines.
When an user selects inline code or text inside a code block it makes no sense to enable the styling options in the toolbar. Code should not be styled. Therefore we disable the toolbar options when code is selected (newly created or existing). To ensure no such styles are applied at all we also disable
controller.formatSelection()
to apply styles to code blocks. That means both the GUI and the controller are blocked.A major cleanup was made in #230 for this feature. Conclusion: We don't need a rule: We did not create a new RuleM for blocking the styles because we need to modify the UI as well. Rules are purely functional and are not the right place to block styles. In fact, the rules are designed to apply additional manipulations/edits on the document. So It's clearly not the right place to write the styling blocking code for code blocks and inlines.