Please keep the <script> tag in the Atto editor

Please keep the <script> tag in the Atto editor

از Dominique Bauer در
Number of replies: 3
تصویر Documentation writers تصویر Particularly helpful Moodlers تصویر Plugin developers

A well-kept secret is that the <style> element can be included inside the <body> of a document. Ref. MDN web docs

For the vast majority of teachers who do not have access to the administration of their Moodle site, it can be very useful to add css on a page using the <style> tag. This can be easily be done using the 'Plain text area' editor.

However, the Atto HTML editor automatically deletes any <style> tags, apparently for no reason, making their use unnecessarily awkward. You can only edit the <style> tag in the Plain text area editor, not in the Atto editor and if you do, your css is erased!

Please modify the Atto editor so that it preserves the <style> tags.

میانگین امتیازات:Useful (1)
In reply to Dominique Bauer

Re: Please keep the <script> tag in the Atto editor

از Matthias Giger در
تصویر Particularly helpful Moodlers
I second that idea. While you can overcome the missing STYLE tag with SPANs and DIVs, it is complicated and makes the code hard to read.
In reply to Matthias Giger

Re: Please keep the <script> tag in the Atto editor

از Dominique Bauer در
تصویر Documentation writers تصویر Particularly helpful Moodlers تصویر Plugin developers

Hello Matthias,

Thank you for supporting this idea. I created Tracker MDL-67420, whose description is as follows:

As you already know, the <style> element does not have to be placed in the <head> section of an HTML file. It can be placed in the <body> section as well.
For teachers who include a lot of content in their courses, for example with elaborate tables, etc., and who do not have access to the site administration, it might be useful for them to use css in a <style> tag in the HTML of activities and ressources.
Note that inserting a <style> tag can be done with the 'Plain text area' editor. However, the Atto HTML editor automatically removes the <style> tag!
Teachers can already modify any style by 1) using the 'Plain text area editor', 2 ) defining the style of individual tags, 3) using JavaScript or jQuery code. However, these methods are somewhat cumbersome compared to the ease of use of the Atto editor.
If, for some reason, the administrator wants to remove the <style> element when teachers use the Atto editor, you could define this as an option that would be set by the administrator, that is, to remove or to keep the <style> element when the Atto editor is used.
In this way, you would preserve the Atto editor as it is defined now, but you would give a very good functionality to those teachers who need extra styling!