Open danowar2k opened 4 years ago
I've found the fix and the reason for the neglection of the beautification. I know that this plugin is integrated with Moodle in later Moodle versions, but I'll just open a pull request detailing the fix for other people still using Moodle 3.5.x .
Browser: Chrome Moodle 3.5.9
When I switch to HTMLplus mode, there seems to be a race condition happening.
https://github.com/andrewnicols/moodle-atto_htmlplus/blob/4ea748b1584ccb2dffc80a1ce2837277479596a1/yui/src/button/js/button.js#L103
When I add a breakpoint somewhere between the beautify and the CodeMirror creation and continue the script, the codemirror editor shows the beautified code.
Without the breakpoint, the following happens using
host.textarea.get('value')
: (A) at this moment the textarea value is beautified (B) at this moment the textarea value is NOT beautified