trix
trix copied to clipboard
toJSON/fromJSON doesn't work on document
The toJSON
and fromJSON
methods on Trix.Document
seem to be broken.
As an example look at this screenshot:
Note: Loading
doc1
results to garbage in the editor.
This also breaks editor.toJSON()
and editor.fromJSON()
as these methods rely on the document methods.
It might be intentional, but it clearly should be.
Steps to Reproduce
- Type something into Trix
- Open the console
- Type
var editor = document.querySelector("trix-editor").editor
- Type
Trix.Document.fromJSON(editor.getDocument().toJSON())
- Look at the produced object or try to load it into the editor (which should produce garbage)
Details
- Trix version: master
- Browser name and version: FireFox 94 using the local test setup
- Operating system: macOS Catalina 10.15.7