clean
Type: Boolean
Specifies if the HTML should be cleaned prior to insertion
From this text one would conclude that passing clean=true should enable cleaning, and passing false -- disable it.
Actual behavior
It seems that true actually disables the cleaning, and false -- enables it. That is, the behavior is inverse. Below is some evidence from Froala 3.1.1 sources (js/froala_editor.min.js formatted with http://unminify.com/).
1. From the implementation of html.insert:
insert: function M(e, t, n) {
var r;
if (
(w.selection.isCollapsed() || w.selection.remove(),
// vvvvvvvvvvvvvvvvvvvvvvvvvvv
(r = t ? e : w.clean.html(e)),
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^
e.indexOf('class="fr-marker"') < 0 &&
(r = (function a(e) {
var t = w.doc.createElement("div");
return (t.innerHTML = e), w.selection.setAtEnd(t, !0), t.innerHTML;
})(r)),
w.node.isEmpty(w.el) && !w.opts.keepFormatOnDelete && f(r))
)
w.el.innerHTML = r;
else {
From here you see that clean.html() is called when the second parameter (clean) is true.
By the time this code runs the inserted content (e) has already been cleaned, and according to the docs one should pass false in the second argument to disable additional cleaning inside html.insert , but actually !0 (true) is passed.
Expected behavior
From the docs (https://froala.com/wysiwyg-editor/docs/methods/#html.insert):
From this text one would conclude that passing clean=
true
should enable cleaning, and passingfalse
-- disable it.Actual behavior
It seems that
true
actually disables the cleaning, andfalse
-- enables it. That is, the behavior is inverse. Below is some evidence from Froala 3.1.1 sources (js/froala_editor.min.js
formatted with http://unminify.com/).1. From the implementation of
html.insert
:From here you see that
clean.html()
is called when the second parameter (clean
) istrue
.2. From the implementation of paste:
By the time this code runs the inserted content (
e
) has already been cleaned, and according to the docs one should passfalse
in the second argument to disable additional cleaning insidehtml.insert
, but actually!0
(true
) is passed.Steps to reproduce the problem
html.insert
: https://froala.com/wysiwyg-editor/docs/methods/#html.insertEditor version
Froala version 3.1.1