trix icon indicating copy to clipboard operation
trix copied to clipboard

toJSON/fromJSON doesn't work on document

Open BuzzwordChief opened this issue 3 years ago • 0 comments

The toJSON and fromJSON methods on Trix.Document seem to be broken.

As an example look at this screenshot: image 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
  1. Type something into Trix
  2. Open the console
  3. Type var editor = document.querySelector("trix-editor").editor
  4. Type Trix.Document.fromJSON(editor.getDocument().toJSON())
  5. 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

BuzzwordChief avatar Nov 20 '21 18:11 BuzzwordChief