wysiwyg-editor
wysiwyg-editor copied to clipboard
Froala 4.2.1: `html.get()` returns an unexpected wrapper div
Update: after reporting #4795 I realized the workaround is the same, so these two issues probably have the same underlying bug:
As a workaround, these options can be set:
{
fontFamilyDefaultSelection: "Font Family",
fontSizeDefaultSelection: "Font Size",
}
Expected behavior.
editor.html.set("<p>Foo</p>")
editor.html.get() === "<p>Foo</p>"
Actual behavior.
editor.html.set("<p>Foo</p>")
editor.html.get() === "<div><p>Foo</p></div>"
Steps to reproduce the problem.
https://codepen.io/dcsaszar/pen/vYwpNJm
<div id="froala"></div>
import * as FroalaEditor from "froala-editor";
const element = document.getElementById("froala");
const editor = new FroalaEditor(element, {}, () => {
editor.html.set("<p>Foo</p>")
editor.html.get()
});
Editor version.
4.2.1
(it works as expected up to 4.2.0)
OS.
macOS 14.5 (23F79)
Browser.
Chrome 125.0.6422.142