wysiwyg-editor icon indicating copy to clipboard operation
wysiwyg-editor copied to clipboard

Froala 4.2.1: `html.get()` returns an unexpected wrapper div

Open dcsaszar opened this issue 8 months ago • 1 comments

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

Recording.
image

dcsaszar avatar Jun 15 '24 06:06 dcsaszar