Moodle Plugins directory: Source code Pro | Moodle.org

Source code Pro
Enhance your Moodle TinyMCE editor with this powerful plugin! Its goal is twofold: to replace the basic text-based editor in Moodle versions prior to 4.3 and to extend the default editor in newer versions with advanced features. These include cursor synchronization, view panel mode (since TinyMCE 6.3), light & dark themes, a VSCode-like mini-tab system, and more —powered by CodeMirror 6 for a seamless coding experience.
This plugin does not include any configuration settings. The installation is straightforward: simply go to Site Administration area (Plugins → Install plugins → Install plugin from ZIP file).
Once the plugin is installed, the items named "Source Code" in the menu, will be replaced by "Source Code Pro". Also a button will be added in the first position of the toolbar.
Thank you. I'm glad to know that you like my plugin.
In principle, the tiny editor should suppport adding the attibute style to HTML elements. Which version of Moodle are you using? At least it works in my version 4.1. Have you tried using class attribute instead of style?
It has been reported in Moodle Tracker issues related with Tiny editor removing certain elements such as SVG or empty tags. In principle, it behaviour could be modified by adding such cases as valid_custom_elements, but this would require the modification of the plugin code.