Details
-
Type:
Task
-
Status: Closed
-
Priority:
Minor
-
Resolution: Done
-
Affects Version/s: 2.7.15
-
Fix Version/s: FRONTEND
-
Component/s: HTML Editor (Atto)
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_27_STABLE
-
Pull from Repository:
-
Pull Master Branch:wip-
MDL-54757 -
Pull Master Diff URL:
Description
One of the use of MDL-54710 is to hide the original while resizing or add a border styling while resizing. These are accomplish by attaching classes to images (or other html elements) that is under a css rule. For instance:
demo.css |
atto-helper-border {
|
border: 1px solid black;
|
}
|
demo.html |
<div class="atto-helper-border">
|
<!-- some contents. -->
|
</div>
|
The problem arises when save/autosave kicks in, saving unwanted styling. For instance, the border that is only intended as a helper will be saved.
To solve this, I will need to point you to the atto's clean.js (found in atto javascript source files). It contains getCleanHTML which is called before save/autosave. So what needs to be done is remove all classes that starts with "atto-helper" so that styles attached to "atto-helper-*" classes are not saved. This is a perfect solution since it goes with the name of the function getCleanHTML, that is, the intended html.