Blank html is not just

Re: text direction code added in 3.9

by Theo Hughes -
Number of replies: 0

There are two issues here.

1. What Moodle puts into a blank editing box initially is, as far as I am aware, specified in one location in the code. You can only change it globally if you have access to the code AND are able to build the code - as of recent versions of Moodle you can't just edit the javascript and have it work... you also have to compile the code. If you, or someone, is able to do this for your installation, then the relevant code is in MoodleCodeRoot\lib\editor\atto\yui\src\editor\js\textarea.js in the function _getEmptyContent. You can change the code there to have blank html be just <p></p> for example. I think the current solution for ltr/rtl text is poor. I think a wrapper for all user created content would be a better fix, and have other advantages. However, I'm currently focused on some education stuff (why I use Moodle) and hope to get back to this later.

2. The atto editor relies on the browser for a lot of the editing functionality. So exactly how it creates / removes tags etc. as you bold / unbold text etc. depends somewhat on the browser you are using. I currently find Firefox to maintain the "cleanest" html "under the hood". I would recommend using it for Moodle editing, but this is only IMHO and you take this advice at your own risk. Also, browser versions change rapidly and the best browser for editing in Moodle may change in the near future.

Best wishes, Theo

Average of ratings: Useful (3)